From 6a906e37704b742169b8c5ce879f2916638785f5 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 18 Jan 2018 11:16:30 +0100 Subject: [PATCH] Fix share modal extension point --- www/common/common-interface.js | 3 --- www/common/common-ui-elements.js | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index c44742ce5..2e067613a 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -57,12 +57,9 @@ define([ }; var customListenForKeys = function (keys, cb, el) { if (!keys || !keys.length || typeof cb !== "function") { return; } - console.log(keys); var handler = function (e) { - console.log('keydown', e.which); e.stopPropagation(); keys.some(function (k) { - console.log(k); // k is number or array // if it's an array, it should be [keyCode, "{ctrl|alt|shift|meta}"] if (Array.isArray(k) && e.which === k[0] && e[k[1] + 'Key']) { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index ffcc5a2b2..5c7005f4f 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -351,15 +351,15 @@ define([ var frameEmbed = UI.dialog.customModal(embed, { buttons: embedButtons}); // Create modal - var tabs = UI.dialog.tabs([{ + var tabs = [{ title: Messages.share_linkCategory, content: frameLink }, { title: Messages.share_embedCategory, content: frameEmbed - }]); + }]; if (typeof(AppConfig.customizeShareOptions) === 'function') { - Config.customizeShareOptions(hashes, tabs, { + AppConfig.customizeShareOptions(hashes, tabs, { type: 'DEFAULT', origin: origin, pathname: pathname @@ -372,7 +372,7 @@ define([ } if (val.embed) { $(link).find('#cp-share-embed').attr('checked', true); } if (val.present) { $(link).find('#cp-share-present').attr('checked', true); } - UI.openCustomModal(tabs); + UI.openCustomModal(UI.dialog.tabs(tabs)); }); }; UIElements.createFileShareModal = function (config) { @@ -432,21 +432,21 @@ define([ var frameEmbed = UI.dialog.customModal(embed, { buttons: embedButtons}); // Create modal - var tabs = UI.dialog.tabs([{ + var tabs = [{ title: Messages.share_linkCategory, content: frameLink }, { title: Messages.share_embedCategory, content: frameEmbed - }]); + }]; if (typeof(AppConfig.customizeShareOptions) === 'function') { - Config.customizeShareOptions(hashes, tabs, { + AppConfig.customizeShareOptions(hashes, tabs, { type: 'FILE', origin: origin, pathname: pathname }); } - UI.openCustomModal(tabs); + UI.openCustomModal(UI.dialog.tabs(tabs)); }; UIElements.createButton = function (common, type, rightside, data, callback) {