Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 9c27234

Browse files
committed
update demo so startProgress will call nextProgress only if it's not
animating
1 parent 4e37c31 commit 9c27234

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

demo.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@
6262
var progress = document.querySelector('paper-progress');
6363
var button = document.querySelector('paper-button');
6464

65-
var repeat, maxRepeat = 5;
65+
var repeat, maxRepeat = 5, animating = false;
6666

6767
function nextProgress() {
68+
animating = true;
6869
if (progress.value < progress.max) {
6970
progress.value += (progress.step || 1);
7071
} else {
7172
if (++repeat >= maxRepeat) {
73+
animating = false;
7274
button.disabled = false;
7375
return;
7476
}
@@ -81,7 +83,9 @@
8183
repeat = 0;
8284
progress.value = progress.min;
8385
button.disabled = true;
84-
nextProgress();
86+
if (!animating) {
87+
nextProgress();
88+
}
8589
}
8690

8791
addEventListener('polymer-ready', function() {

0 commit comments

Comments
 (0)