From d41b314e4d10883b787db75ff7ec0b0c2ca7970e Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 4 Jul 2019 15:35:35 +0200 Subject: [PATCH 1/2] Fix invisible share modal stuck --- www/common/common-ui-elements.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 2cb6380b7..bc465cdfb 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -701,7 +701,10 @@ define([ }, keys: [13] }]; - var frameLink = UI.dialog.customModal(link, {buttons: linkButtons}); + var frameLink = UI.dialog.customModal(link, { + buttons: linkButtons, + onClose: config.onClose, + }); // Embed tab var embed = h('div.cp-share-modal', [ @@ -728,7 +731,10 @@ define([ }, keys: [13] }]; - var frameEmbed = UI.dialog.customModal(embed, { buttons: embedButtons}); + var frameEmbed = UI.dialog.customModal(embed, { + buttons: embedButtons, + onClose: config.onClose, + }); // Create modal var tabs = [{ From df5090eaef1cdb259d8815f47a2076fcd6139bf7 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 4 Jul 2019 15:51:29 +0200 Subject: [PATCH 2/2] Fix missing pad title in notifications --- www/common/sframe-common-title.js | 3 ++- www/common/toolbar3.js | 10 ++++++++-- www/file/inner.js | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index 496cbfcb9..5f748347c 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -79,7 +79,8 @@ define([ return { updateTitle: exp.updateTitle, suggestName: suggestTitle, - defaultName: exp.defaultTitle + defaultName: exp.defaultTitle, + getTitle: exp.getTitle }; }; diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 8ace0be64..d6b116df3 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -534,8 +534,11 @@ MessengerUI, Messages) { hidden: true }); $shareBlock.click(function () { + var title = (config.title && config.title.getTitle && config.title.getTitle()) + || (config.title && config.title.defaultName) + || ""; Common.getSframeChannel().event('EV_SHARE_OPEN', { - title: Common.getMetadataMgr().getMetadata().title + title: title }); }); @@ -559,7 +562,10 @@ MessengerUI, Messages) { file: true }); $shareBlock.click(function () { + var title = (config.title && config.title.getTitle && config.title.getTitle()) + || ""; Common.getSframeChannel().event('EV_SHARE_OPEN', { + title: title, file: true }); }); @@ -724,7 +730,7 @@ MessengerUI, Messages) { }; var createPageTitle = function (toolbar, config) { - if (config.title || !config.pageTitle) { return; } + if (!config.pageTitle) { return; } var $titleContainer = $('', { 'class': TITLE_CLS }).appendTo(toolbar.$top); diff --git a/www/file/inner.js b/www/file/inner.js index 2f90235a7..efbbd46a4 100644 --- a/www/file/inner.js +++ b/www/file/inner.js @@ -123,7 +123,10 @@ define([ common.setPadAttribute('fileType', metadata.type); } - toolbar.addElement(['pageTitle'], {pageTitle: title}); + toolbar.addElement(['pageTitle'], { + pageTitle: title, + title: Title.getTitleConfig(), + }); toolbar.$rightside.append(common.createButton('forget', true)); toolbar.$rightside.append(common.createButton('properties', true)); if (common.isLoggedIn()) {