Fix modal support for vue apps

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-06-15 16:42:45 +02:00
parent 6b5db20fc9
commit 7723529d31
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 6 additions and 1 deletions

View File

@ -210,9 +210,14 @@ $.widget('oc.ocdialog', {
}
const self = this
let contentDiv = $('#content')
if (contentDiv.length === 0) {
// nextcloud-vue compatibility
contentDiv = $('.content')
}
this.overlay = $('<div>')
.addClass('oc-dialog-dim')
.appendTo($('#content'))
.appendTo(contentDiv)
this.overlay.on('click keydown keyup', function(event) {
if (event.target !== self.$dialog.get(0) && self.$dialog.find($(event.target)).length === 0) {
event.preventDefault()