Author: abelevich
Date: 2007-09-17 09:14:13 -0400 (Mon, 17 Sep 2007)
New Revision: 2952
Modified:
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
Log:
fix RF-895
Modified:
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
===================================================================
---
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-09-17
06:40:24 UTC (rev 2951)
+++
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-09-17
13:14:13 UTC (rev 2952)
@@ -7,9 +7,14 @@
this.tip = $( tip );
this.track = $( track );
this.mainTable = $( table );
+
+ //this.optionsInputId = options.optionsInputId;
+
+ //this.optionInput = $(this.optionsInputId) ||
document.getElementById(this.optionsInputId);
+
this.input = $( options.inputId ) || document.getElementsByName(options.inputId)[0];
this.options= options || {};
-
+
this.classes = {};
this.classes.arrow = "dr-insldr-handler rich-inslider-handler";
this.classes.arrowSelected = "dr-insldr-handler-sel
rich-inslider-handler-selected";
@@ -18,9 +23,8 @@
this.classes.handleSelected = " " + handleSelectedClass;
this.table = this.findTableForTrack(this.track);
-
+
this.input.value = this.options.sliderValue;
-
this.prevInputValue = this.input.value;
this.graggedImageOn = false;
this.range = this.options.range || $R(0,1);
@@ -90,7 +94,8 @@
Event.observe(this.input, "change", this.eventInputChange);
}
this.initialized = true;
- this.setInitialValue();
+
+ //this.setInitialValue();
//Event.observe(window, "load",
this.setInitialValue.bindAsEventListener(this)); //FIX RFA-190
//Event.observe($(input), "propertychange",
this.setInitialValue.bindAsEventListener(this));
@@ -185,6 +190,7 @@
this.value = sliderValue;
if (!this.editInFocus && (this.required || "" != this.input.value ||
this.updating)){
this.input.value = this.value;
+ // this.optionInput.value = this.value;
this.handle.style.left = this.translateToPx(sliderValue);
} else {
this.handle.style.left = "-2px";
@@ -339,6 +345,7 @@
if (isNaN(Number(this.input.value))){
this.setValue(Number(this.value));
this.input.value = this.value;
+
if (this.eventError){
this.eventError();
}
@@ -375,11 +382,16 @@
},
load: function(){
- this.setValue( this.value );
+ // fix RF-895
+ if(this.input.value){
+ this.options.sliderValue = this.input.value;
+ }
+
+ this.setInitialValue();
+ //this.setValue( this.value );
},
trim : function(str){
return str.replace(/^\s+|\s+$/, '');
}
-
}
Show replies by date