Skip to content

Commit e47c3ab

Browse files
committed
Don't reapply styles on subsequent initializations
1 parent 1593b5f commit e47c3ab

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

jquery-css-progress-bar-min.js

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery-css-progress-bar.js

+8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
var methods = {
44
init : function (options) {
5+
var applied = this.data("cssProgressBar");
6+
if (applied) {
7+
return this;
8+
}
9+
this.data("cssProgressBar", true);
10+
511
this.addClass("ui-progress-bar");
612
this.addClass("ui-container");
713
this.addClass("transition");
14+
815
var progressDiv = document.createElement('div');
916
progressDiv.setAttribute("class", "ui-progress");
1017
progressDiv.setAttribute("style", "width: 0%;");
1118
this.append(progressDiv);
19+
1220
return this;
1321
},
1422
update : function (perc) {

0 commit comments

Comments
 (0)