]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix modal support for vue apps
authorJoas Schilling <coding@schilljs.com>
Mon, 15 Jun 2020 14:42:45 +0000 (16:42 +0200)
committerJoas Schilling <coding@schilljs.com>
Mon, 15 Jun 2020 14:56:13 +0000 (16:56 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
core/src/jquery/ocdialog.js

index 518a28f75d313537151bfde288c0161ec4c1767c..8c4a7602a78cfca4da140a8cc4c7111792c383a3 100644 (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()