Merge pull request #21543 from nextcloud/backport/21417/stable18

[stable18] Fix modal support for vue apps and dark theme
This commit is contained in:
Joas Schilling 2020-06-24 13:32:44 +02:00 committed by GitHub
commit 3a59ea88a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 10 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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -108,7 +108,7 @@ const Dialogs = {
'none',
buttons,
callback,
modal
modal === undefined ? true : modal
)
},
/**

View file

@ -72,6 +72,10 @@
height: 100%;
}
body.dark .oc-dialog-dim {
opacity: .8;
}
.oc-dialog-content {
width: 100%;
max-width: 550px;

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()