From 0b6a0337fefce4f5168d228d012b715ff916a0a6 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 20 Feb 2014 21:30:30 +0100 Subject: [PATCH] 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. --- public_html/media/js/post-upload.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public_html/media/js/post-upload.js b/public_html/media/js/post-upload.js index 590e4a99..f03b375b 100644 --- a/public_html/media/js/post-upload.js +++ b/public_html/media/js/post-upload.js @@ -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)