From b1f74b0056b76402fbd618faff817432dec77ee3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:42:45 +0200 Subject: [PATCH 1/5] Fix modal support for vue apps Signed-off-by: Joas Schilling --- core/src/jquery/ocdialog.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/jquery/ocdialog.js b/core/src/jquery/ocdialog.js index 518a28f75d..8c4a7602a7 100644 --- a/core/src/jquery/ocdialog.js +++ b/core/src/jquery/ocdialog.js @@ -210,9 +210,14 @@ $.widget('oc.ocdialog', { } const self = this + let contentDiv = $('#content') + if (contentDiv.length === 0) { + // nextcloud-vue compatibility + contentDiv = $('.content') + } this.overlay = $('
') .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() From be0ecbc8c7f855cb0c9822233e38a9b459b80b58 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:43:18 +0200 Subject: [PATCH 2/5] Make the confirm dialog modal by default Signed-off-by: Joas Schilling --- core/src/OC/dialogs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index 380aeb3a76..2c8ecc54e3 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -107,7 +107,7 @@ const Dialogs = { 'none', buttons, callback, - modal + modal === undefined ? true : modal ) }, /** @@ -1245,7 +1245,7 @@ const Dialogs = { dir: '', name: '' // Ugly but works ;) }, { escapeFunction: null }).prependTo(this.$dirTree) - + }, /** * handle selection made in the tree list From b5140309e570524f75a1d53b393d85dbbeacb70e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:54:31 +0200 Subject: [PATCH 3/5] Add darkmode support for the modal background Signed-off-by: Joas Schilling --- core/src/jquery/css/jquery.ocdialog.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/jquery/css/jquery.ocdialog.scss b/core/src/jquery/css/jquery.ocdialog.scss index 89653ae181..1bb59512e5 100644 --- a/core/src/jquery/css/jquery.ocdialog.scss +++ b/core/src/jquery/css/jquery.ocdialog.scss @@ -62,7 +62,7 @@ } .oc-dialog-dim { - background-color: #000; + background-color: var(--color-main-text); opacity: .2; z-index: 9999; position: fixed; From 2d96e8938667720c9538de426c895500dd7b7caf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:44:59 +0200 Subject: [PATCH 4/5] Rebuild JS files Signed-off-by: Joas Schilling --- core/js/dist/login.js | 2 +- core/js/dist/login.js.map | 2 +- core/js/dist/main.js | 6 +++--- core/js/dist/main.js.map | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/js/dist/login.js b/core/js/dist/login.js index 5ffe17797b..d6cc102527 100644 --- a/core/js/dist/login.js +++ b/core/js/dist/login.js @@ -46,7 +46,7 @@ i.version="2.26.0",t=xt,i.fn=yn,i.min=function(){var e=[].slice.call(arguments,0 * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - */var F={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,dialogsCounter:0,alert:function(e,t,n,r){this.message(e,t,"alert",F.OK_BUTTON,n,r)},info:function(e,t,n,r){this.message(e,t,"info",F.OK_BUTTON,n,r)},confirm:function(e,t,n,r){return this.message(e,t,"notice",F.YES_NO_BUTTONS,n,r)},confirmDestructive:function(e,t,n,r,i){return this.message(e,t,"none",n,r,i)},confirmHtml:function(e,t,n,r){return this.message(e,t,"notice",F.YES_NO_BUTTONS,n,r,!0)},prompt:function(e,n,r,i,a,o){return s.a.when(this._getMessageTemplate()).then((function(u){var c="oc-dialog-"+F.dialogsCounter+"-content",l="#"+c,f=u.octemplate({dialog_name:c,title:n,message:e,type:"notice"}),h=s()("");h.attr("type",o?"password":"text").attr("id",c+"-input").attr("placeholder",a);var p=s()("