diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-29 05:17:25 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-29 05:17:25 -0700 |
commit | a533099e8ad549d39b21230d12a2099d5d679f4e (patch) | |
tree | 17dbd66c7898a0f4cf034c9630b3626300de63bc | |
parent | 3461b4e8e65791ae4e01fd45da5df76a9a929dbf (diff) | |
parent | e6d6e498c0acbe1e97b07c0c5a357a84b65f06f9 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
-rw-r--r-- | modules/gallery/views/admin_maintenance_task.html.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php index 534cac82..6ab87e3f 100644 --- a/modules/gallery/views/admin_maintenance_task.html.php +++ b/modules/gallery/views/admin_maintenance_task.html.php @@ -5,14 +5,18 @@ var delta = 1; animate_progress_bar = function() { var current_value = Number($(".gProgressBar div").css("width").replace("%", "")); - if (current_value != target_value) { + if (target_value > current_value) { + // speed up + delta = Math.min(delta + 0.04, 3); + } else { + // slow down + delta = Math.max(delta - 0.05, 1); + } + + if (target_value == 100) { + $(".gProgressBar").progressbar("value", 100); + } else if (current_value != target_value || delta != 1) { var new_value = Math.min(current_value + delta, target_value); - if (target_value - current_value > delta) { - delta += .075; - } - if (target_value == 100) { - new_value = 100; - } $(".gProgressBar").progressbar("value", new_value); animation = setTimeout(function() { animate_progress_bar(target_value); }, 100); } else { |