Skip to content

Commit 6a2965e

Browse files
committed
doubleCompletePrevention hack
1 parent 5a066ac commit 6a2965e

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

ytLoad.jquery.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,29 @@
2929
var width = (101 / 100) * progress;
3030
width = Math.round(width * 100) / 100;
3131

32+
// TODO: Is this a jquery.transit bug? Research error cause further and fill out proper bug report.
33+
var doubleCompletePrevention = false;
34+
3235
$progressBar.transit({
3336
width: width+'%',
3437
duration: duration,
3538
complete: function() {
36-
if(width > 99) {
37-
$progressBar.delay(settings.fadeDelay);
38-
$progressBar.fadeOut({
39-
duration: settings.fadeDuration,
40-
complete: function() {
41-
$progressBar.remove();
42-
}
43-
});
44-
settings.onComplete();
45-
}
46-
if(finished) {
47-
finished();
39+
if(doubleCompletePrevention) {
40+
if(width > 99) {
41+
$progressBar.delay(settings.fadeDelay);
42+
$progressBar.fadeOut({
43+
duration: settings.fadeDuration,
44+
complete: function() {
45+
$progressBar.remove();
46+
}
47+
});
48+
settings.onComplete();
49+
}
50+
if(finished) {
51+
finished();
52+
}
53+
} else {
54+
doubleCompletePrevention = true;
4855
}
4956
}
5057
});

0 commit comments

Comments
 (0)