Fix cornerPopup timeout not always applied

pull/1/head
yflory 5 years ago
parent d0bce11c21
commit 2cceb54aac

@ -1148,7 +1148,14 @@ define([
var deletePopup = function () {
$popup.remove();
if (!corner.queue.length) {
corner.state = false;
// Make sure no other popup is displayed in the next 5s
setTimeout(function () {
if (corner.queue.length) {
$('body').append(corner.queue.pop());
return;
}
corner.state = false;
}, 5000);
return;
}
setTimeout(function () {

@ -4306,6 +4306,9 @@ define([
var initialHide = data && data.autoStore && data.autoStore === -1;
var modal = UI.cornerPopup(text, actions, footer, {hidden: initialHide});
// Once the store pad popup is created, put the crowdfunding one in the queue
UIElements.displayCrowdfunding(common);
autoStoreModal[priv.channel] = modal;
$(modal.popup).find('.cp-corner-footer a').click(function (e) {
@ -4314,7 +4317,6 @@ define([
});
$(hide).click(function () {
UIElements.displayCrowdfunding(common);
delete autoStoreModal[priv.channel];
modal.delete();
});
@ -4334,7 +4336,6 @@ define([
$(document).trigger('cpPadStored');
delete autoStoreModal[priv.channel];
modal.delete();
UIElements.displayCrowdfunding(common);
UI.log(Messages.autostore_saved);
});
});

Loading…
Cancel
Save