From 82bb71006024f8fa58ae3f427dadb2a2029befc2 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 22 Nov 2019 16:40:20 +0100 Subject: [PATCH] Don't close the share modal when clicking Preview --- www/common/common-interface.js | 3 ++- www/common/common-ui-elements.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index bc4344f36..2ea037ab0 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -348,7 +348,8 @@ define([ if (!b.name || !b.onClick) { return; } var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name); $(button).click(function () { - b.onClick(); + var noClose = b.onClick(); + if (noClose) { return; } var $modal = $(button).parents('.alertify').first(); if ($modal.length && $modal[0].closeModal) { $modal[0].closeModal(function () { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index cf33ae4f8..01328a42f 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1101,6 +1101,7 @@ define([ embed: Util.isChecked($(link).find('#cp-share-embed')) }); window.open(v); + return true; }, keys: [[13, 'ctrl']] },