Author: konstantin.mishin
Date: 2010-12-24 15:10:20 -0500 (Fri, 24 Dec 2010)
New Revision: 20796
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
Log:
RF-4464
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-12-24
19:12:09 UTC (rev 20795)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-12-24
20:10:20 UTC (rev 20796)
@@ -44,13 +44,16 @@
this.element = jQuery(this.attachToDom());
this.input =
this.element.children(".rf-insl-inp-cntr").children(".rf-insl-inp");
this.track =
this.element.children(".rf-insl-trc-cntr").children(".rf-insl-trc");
- this.handle = this.track.children(".rf-insl-hnd, .rf-insl-hnd-dis");
+ var handleContainer = this.track.children("span");
+ this.handle = handleContainer.children(".rf-insl-hnd,
.rf-insl-hnd-dis");
this.tooltip = this.element.children(".rf-insl-tt");
var value = Number(this.input.val());
if (isNaN(value)) {
value = this.minValue;
}
+ handleContainer.css("display", "block");
+ this.track.css("padding-right", this.handle.width() + "px");
this.__setValue(value, null, true);
if (!this.disabled) {
@@ -95,8 +98,8 @@
}
if (value != this.value) {
this.input.val(value);
- var left = (value - this.minValue) * (this.track.width() -
this.handle.width()) / this.range;
- this.handle.css("margin-left", left + "px");
+ var left = 100 * (value - this.minValue) / this.range;
+ this.handle.css("margin-left", left + "%");
this.tooltip.text(value);
this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, 5]});
//TODO Seems offset doesn't work now.
this.value = value;
@@ -168,7 +171,7 @@
},
__mousemoveHandler: function (event) {
- var value = this.range * (event.pageX - this.track.position().left) /
(this.track.width()
+ var value = this.range * (event.pageX - this.track.position().left -
this.handle.width() / 2) / (this.track.width()
- this.handle.width()) + this.minValue;
value = Math.round(value / this.step) * this.step; //TODO Add normal support of
float values. E.g. '0.3' should be instead of '0.30000000000000004'.
this.__setValue(value, event);
Modified: trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-12-24
19:12:09 UTC (rev 20795)
+++ trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-12-24
20:10:20 UTC (rev 20796)
@@ -53,7 +53,9 @@
<span
class="rf-insl-mx">#{component.attributes['maxValue']}</span>
</c:if>
<span class="rf-insl-trc
#{component.attributes['trackClass']}">
- <span class="rf-insl-hnd#{component.attributes['disabled'] ?
'-dis' : ''} #{component.attributes['handleClass']}" />
+ <span>
+ <span class="rf-insl-hnd#{component.attributes['disabled'] ?
'-dis' : ''} #{component.attributes['handleClass']}" />
+ </span>
</span>
</span>
<c:if test="#{component.attributes['showArrows']}">
Show replies by date