diff options
author | Gary Kim <gary@garykim.dev> | 2020-06-29 20:56:02 +0300 |
---|---|---|
committer | Gary Kim <gary@garykim.dev> | 2020-06-30 16:45:06 +0300 |
commit | 8773ae49c57d7135a1c59ba958f36d185601baf1 (patch) | |
tree | b5bcd2d40cb6314b37068993f5db33e267306b29 /core/src | |
parent | 26aa83890667202154ef086e27e769919fb56a47 (diff) |
Make closing dialogs callback with false
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/OC/dialogs.js | 1 | ||||
-rw-r--r-- | core/src/jquery/ocdialog.js | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index 2c8ecc54e32..9f2a24a4deb 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -625,6 +625,7 @@ const Dialogs = { $(dialogId).ocdialog({ closeOnEscape: true, + closeCallback: () => { callback && callback(false) }, modal: modal, buttons: buttonlist }) diff --git a/core/src/jquery/ocdialog.js b/core/src/jquery/ocdialog.js index 8c4a7602a78..0fcc33c90a0 100644 --- a/core/src/jquery/ocdialog.js +++ b/core/src/jquery/ocdialog.js @@ -27,6 +27,7 @@ $.widget('oc.ocdialog', { height: 'auto', closeButton: true, closeOnEscape: true, + closeCallback: null, modal: false, }, _create: function() { @@ -169,6 +170,7 @@ $.widget('oc.ocdialog', { const $closeButton = $('<a class="oc-dialog-close"></a>') this.$dialog.prepend($closeButton) $closeButton.on('click', function() { + self.options.closeCallback && self.options.closeCallback() self.close() }) } else { |