Merge pull request #21541 from nextcloud/backport/21417/stable19
[stable19] Fix modal support for vue apps and dark theme
This commit is contained in:
commit
d4343de3eb
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
|
@ -107,7 +107,7 @@ const Dialogs = {
|
||||||
'none',
|
'none',
|
||||||
buttons,
|
buttons,
|
||||||
callback,
|
callback,
|
||||||
modal
|
modal === undefined ? true : modal
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -1245,7 +1245,7 @@ const Dialogs = {
|
||||||
dir: '',
|
dir: '',
|
||||||
name: '' // Ugly but works ;)
|
name: '' // Ugly but works ;)
|
||||||
}, { escapeFunction: null }).prependTo(this.$dirTree)
|
}, { escapeFunction: null }).prependTo(this.$dirTree)
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* handle selection made in the tree list
|
* handle selection made in the tree list
|
||||||
|
|
|
@ -72,6 +72,10 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.dark .oc-dialog-dim {
|
||||||
|
opacity: .8;
|
||||||
|
}
|
||||||
|
|
||||||
.oc-dialog-content {
|
.oc-dialog-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 550px;
|
max-width: 550px;
|
||||||
|
|
|
@ -210,9 +210,14 @@ $.widget('oc.ocdialog', {
|
||||||
}
|
}
|
||||||
|
|
||||||
const self = this
|
const self = this
|
||||||
|
let contentDiv = $('#content')
|
||||||
|
if (contentDiv.length === 0) {
|
||||||
|
// nextcloud-vue compatibility
|
||||||
|
contentDiv = $('.content')
|
||||||
|
}
|
||||||
this.overlay = $('<div>')
|
this.overlay = $('<div>')
|
||||||
.addClass('oc-dialog-dim')
|
.addClass('oc-dialog-dim')
|
||||||
.appendTo($('#content'))
|
.appendTo(contentDiv)
|
||||||
this.overlay.on('click keydown keyup', function(event) {
|
this.overlay.on('click keydown keyup', function(event) {
|
||||||
if (event.target !== self.$dialog.get(0) && self.$dialog.find($(event.target)).length === 0) {
|
if (event.target !== self.$dialog.get(0) && self.$dialog.find($(event.target)).length === 0) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
Loading…
Reference in New Issue