From 68f1b01902f5246e2e321cdfcf2730fe7327ed67 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 31 Mar 2013 22:58:03 +0200 Subject: [PATCH] Set the progressbar to undefined when an error occurred --- script.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 312f655..39bd671 100644 --- a/script.js +++ b/script.js @@ -64,8 +64,12 @@ jQuery(function() { skip: skip }, function(data) { - $progressbar.progressbar('option', 'value', data.pages + data.media - data.remaining); - $progressbar.progressbar('option', 'max', data.pages + data.media); + if (data.remaining === false) { + $progressbar.progressbar('option', 'value', false); + } else { + $progressbar.progressbar('option', 'value', data.pages + data.media - data.remaining); + $progressbar.progressbar('option', 'max', data.pages + data.media); + } $message.html(data.html); if (data.remaining === false) { $container.find('form.pagemove__nscontinue, form.pagemove__nsskip').submit(submit_handler);