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 = [{ 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()) {