From e7a72896d5d5c6b518a2ddc656048508a1326c80 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Mar 2021 16:54:38 +0100 Subject: [PATCH] Enable properties modal when the pad is not stored --- www/common/common-ui-elements.js | 7 +----- www/common/inner/properties.js | 36 ++++++++++++++++++++----------- www/common/onlyoffice/main.js | 8 +++++++ www/common/sframe-common-outer.js | 11 +++++++++- www/secureiframe/inner.js | 2 +- www/secureiframe/main.js | 1 + 6 files changed, 45 insertions(+), 20 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 14c7a298b..104756fac 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -836,12 +836,7 @@ define([ .text(Messages.propertiesButton)) .click(common.prepareFeedback(type)) .click(function () { - common.isPadStored(function (err, data) { - if (!data) { - return void UI.alert(Messages.autostore_notAvailable); - } - sframeChan.event('EV_PROPERTIES_OPEN'); - }); + sframeChan.event('EV_PROPERTIES_OPEN'); }); break; case 'save': // OnlyOffice save diff --git a/www/common/inner/properties.js b/www/common/inner/properties.js index f5780d4c2..ddbf017fc 100644 --- a/www/common/inner/properties.js +++ b/www/common/inner/properties.js @@ -18,6 +18,16 @@ define([ opts = opts || {}; var $d = $('
'); if (!data) { return void cb(void 0, $d); } + data = Util.clone(data); + + var privateData = common.getMetadataMgr().getPrivateData(); + if (privateData.propChannels) { + var p = privateData.propChannels; + data.channel = data.channel || p.channel; + data.rtChannel = data.rtChannel || p.rtChannel; + data.lastVersion = data.lastVersion || p.lastVersion; + data.lastCpHash = data.lastCpHash || p.lastCpHash; + } if (data.channel) { $('