Merge pull request #21630 from nextcloud/fix/21627/close-x

Make closing dialogs callback with false
This commit is contained in:
Roeland Jago Douma 2020-06-30 19:38:37 +02:00 committed by GitHub
commit aca0046aec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -625,6 +625,7 @@ const Dialogs = {
$(dialogId).ocdialog({
closeOnEscape: true,
closeCallback: () => { callback && callback(false) },
modal: modal,
buttons: buttonlist
})

View file

@ -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 {