From 43904df0fbe9786c60638db2db42e8d290e6c4e1 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 7 Apr 2020 17:04:39 +0200 Subject: [PATCH] Display properties modal in the secure iframe --- www/common/common-ui-elements.js | 6 +----- www/common/sframe-common-outer.js | 4 ++++ www/secureiframe/inner.js | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 2aa47096f..9644c7070 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1607,11 +1607,7 @@ define([ if (!data) { return void UI.alert(Messages.autostore_notAvailable); } - require(['/common/inner/properties.js'], function (Properties) { - Properties.getPropertiesModal(common, {}, function (e) { - if (e) { console.error(e); } - }); - }); + sframeChan.event('EV_PROPERTIES_OPEN'); }); }); break; diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index a7ffd206c..98aa7c8a2 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -1020,6 +1020,10 @@ define([ initSecureModal('filepicker', data || {}, cb); }); + sframeChan.on('EV_PROPERTIES_OPEN', function (data) { + initSecureModal('properties', data || {}, null); + }); + sframeChan.on('EV_ACCESS_OPEN', function (data) { initSecureModal('access', data || {}, null); }); diff --git a/www/secureiframe/inner.js b/www/secureiframe/inner.js index 343774662..c0cff823b 100644 --- a/www/secureiframe/inner.js +++ b/www/secureiframe/inner.js @@ -73,6 +73,20 @@ define([ displayed = modal; }; + // Properties modal + create['properties'] = function (data) { + require(['/common/inner/properties.js'], function (Properties) { + Properties.getPropertiesModal(common, { + onClose: function () { + hideIframe(); + } + }, function (e) { + if (e) { console.error(e); } + displayed = modal; + }); + }); + }; + // Access modal create['access'] = function (data) { require(['/common/inner/access.js'], function (Access) {