Author: a.izobov
Date: 2007-08-28 04:18:10 -0400 (Tue, 28 Aug 2007)
New Revision: 2523
Modified:
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
Log:
http://jira.jboss.com/jira/browse/RF-635
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-08-28
03:41:43 UTC (rev 2522)
+++
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-08-28
08:18:10 UTC (rev 2523)
@@ -183,9 +183,11 @@
}
sliderValue = this.getNearestValue(sliderValue);
this.value = sliderValue;
- this.handle.style.left = this.translateToPx(sliderValue);
if (!this.editInFocus && (this.required || "" != this.input.value ||
this.updating)){
this.input.value = this.value;
+ this.handle.style.left = this.translateToPx(sliderValue);
+ } else {
+ this.handle.style.left = "-2px";
}
if (!this.tip.firstChild) {
this.tip.appendChild(window.document.createTextNode(this.value));
Modified:
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
===================================================================
---
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-08-28
03:41:43 UTC (rev 2522)
+++
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-08-28
08:18:10 UTC (rev 2523)
@@ -42,39 +42,47 @@
switchItems: function( e ) {
var editValue = this.controls.edit.value;
if (e == 'up'){
- editValue -= this.delta*-1;
- editValue = this.roundFloat(editValue);
- if ( editValue <= this.max && editValue >= this.min){
- this.controls.edit.value = editValue;
+ if ("" == editValue) {
+ this.controls.edit.value = this.min;
} else {
- if (this.cycled){
- if (this.delta>0){
- this.controls.edit.value = this.min;
+ editValue -= this.delta*-1;
+ editValue = this.roundFloat(editValue);
+ if ( editValue <= this.max && editValue >= this.min){
+ this.controls.edit.value = editValue;
+ } else {
+ if (this.cycled){
+ if (this.delta>0){
+ this.controls.edit.value = this.min;
+ } else {
+ this.controls.edit.value = this.max;
+ }
} else {
+ this.error();
+ this.controls.fireEditEvent("error");
this.controls.edit.value = this.max;
}
- } else {
- this.error();
- this.controls.fireEditEvent("error");
- this.controls.edit.value = this.max;
}
}
} else {
- editValue -= this.delta;
- editValue = this.roundFloat(editValue);
- if (editValue >= this.min && editValue <= this.max){
- this.controls.edit.value = editValue;
+ if ("" == editValue) {
+ this.controls.edit.value = this.max;
} else {
- if (this.cycled){
- if (this.delta<0){
+ editValue -= this.delta;
+ editValue = this.roundFloat(editValue);
+ if (editValue >= this.min && editValue <= this.max){
+ this.controls.edit.value = editValue;
+ } else {
+ if (this.cycled){
+ if (this.delta<0){
+ this.controls.edit.value = this.min;
+ } else {
+ this.controls.edit.value = this.max;
+ }
+ } else {
+ this.error();
+ this.controls.fireEditEvent("error");
this.controls.edit.value = this.min;
- } else {
- this.controls.edit.value = this.max;
}
- } else {
- this.error();
- this.controls.fireEditEvent("error");
- this.controls.edit.value = this.min;
}
}
}