From 0b1795e5a1fb52bdba6b0a23e0b18b163606521e Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 31 Jan 2018 12:08:55 +0100 Subject: [PATCH] Fix an issue preventing the share modal to be used more than once --- www/common/common-interface.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index f35b361ba..c4e95ae63 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -317,11 +317,11 @@ define([ message = dialog.message(msg); } - var close = Util.once(function (el) { + var close = function (el) { var $el = $(el).fadeOut(150, function () { - $el.remove(); + $el.detach(); }); - }); + }; var navs = []; opt.buttons.forEach(function (b) { @@ -329,7 +329,7 @@ define([ var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name); $(button).click(function () { b.onClick(); - close($(this).parents('.alertify').first()); + close($(button).parents('.alertify').first()); }); if (b.keys && b.keys.length) { $(button).attr('data-keys', JSON.stringify(b.keys)); } navs.push(button); @@ -352,6 +352,7 @@ define([ if (!$(el).is(':visible')) { return; } $(el).click(); }, frame); + $(el).removeAttr('data-keys'); }); document.body.appendChild(frame); $(frame).focus();