Fix an issue preventing the share modal to be used more than once

pull/1/head
yflory 7 years ago
parent f6926699bc
commit 0b1795e5a1

@ -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();

Loading…
Cancel
Save