Exit confirmation tweaks in post upload

Confirmation is disabled after user removes last file from the upload queue.
It's enabled again whenever user adds something.
This commit is contained in:
Marcin Kurczewski 2014-02-20 21:30:30 +01:00
parent 4b08686393
commit 0b6a0337fe

View file

@ -224,7 +224,6 @@ $(function()
{
for (var i = 0; i < inputs.length; i ++)
{
enableExitConfirmation();
var input = inputs[i];
var postDom = $('#post-template').clone(true);
postDom.find('form').submit(false);
@ -238,9 +237,15 @@ $(function()
callback(postDom, input);
}
if ($('.posts .post').length == 0)
{
disableExitConfirmation();
$('#upload-step2').fadeOut();
}
else
{
enableExitConfirmation();
$('#upload-step2').fadeIn();
}
}
$('.post img').mouseenter(function(e)