Author: andrei_exadel
Date: 2008-01-08 11:25:01 -0500 (Tue, 08 Jan 2008)
New Revision: 5186
Modified:
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Log:
a little refactoring
Modified:
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
---
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-01-08
16:07:45 UTC (rev 5185)
+++
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-01-08
16:25:01 UTC (rev 5186)
@@ -23,9 +23,10 @@
if (val.indexOf("%") < 0)
val = val + "%";
}
- if (p <= 0) this.switchMode("initial");
- else if (p > 0 && p < 100) this.switchMode("progress");
- else if (p >= 100) this.switchMode("completed");
+ if ($(this.id + ":progressState") != null)
+ if (p <= 0) this.switchMode("initial");
+ else if (p > 0 && p < 100) this.switchMode("progress");
+ else if (p >= 100) this.switchMode("completed");
var d = $(this.id + ":remain");
if (d != null) d.innerHTML = val;
@@ -52,7 +53,6 @@
this.mode = mode;
},
hideStates : function () {
- var d = $(arguments[0]);
for (i = 0 ; i < arguments.length; i++) {
d = $(arguments[i]);
if (d != null) this.hide(d);
@@ -65,9 +65,11 @@
else if (p >= 100) this.switchMode("completed");
},
hide : function (o) {
+ if (o != null)
o.style.display = 'none';
},
show : function (o) {
+ if (o != null)
o.style.display = '';
}
});
Show replies by date