Author: vmolotkov
Date: 2008-04-23 08:50:12 -0400 (Wed, 23 Apr 2008)
New Revision: 8093
Modified:
trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2495
Modified: trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
===================================================================
--- trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2008-04-23
12:08:28 UTC (rev 8092)
+++ trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2008-04-23
12:50:12 UTC (rev 8093)
@@ -71,6 +71,7 @@
<name> width </name>
<classname>java.lang.String</classname>
<description> The width of a slider control</description>
+ <defaultvalue><![CDATA["200px"]]></defaultvalue>
</property>
<property hidden="true">
<name> height </name>
Modified:
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss
===================================================================
---
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss 2008-04-23
12:08:28 UTC (rev 8092)
+++
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss 2008-04-23
12:50:12 UTC (rev 8093)
@@ -5,7 +5,7 @@
<f:verbatim><![CDATA[
.dr-insldr {
- width : 200px;
+ /*width : 200px;*/
height : 20px;
}
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 2008-04-23
12:08:28 UTC (rev 8092)
+++
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2008-04-23
12:50:12 UTC (rev 8093)
@@ -218,7 +218,7 @@
},
maximumOffset: function(){
- return this.removePx(this.track.style.width || this.track.offsetWidth);
+ return this.removePx(this.track.style.width || this.track.offsetWidth ||
this.options.width);
},
removePx: function(e){
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-04-23
12:08:28 UTC (rev 8092)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-04-23
12:50:12 UTC (rev 8093)
@@ -9,6 +9,8 @@
baseclass="org.richfaces.renderkit.InputNumberSliderRendererBase"
component="org.richfaces.component.UIInputNumberSlider"
+ <jsp:directive.page
import="org.richfaces.component.util.HtmlUtil" />
+
<h:styles>css/slider.xcss</h:styles>
<h:scripts>new
org.ajax4jsf.javascript.PrototypeScript(),script/SliderScript.js,/org/richfaces/renderkit/html/scripts/browser_info.js,/org/richfaces/renderkit/html/scripts/events.js</h:scripts>
<f:clientid var="clientId"/>
@@ -19,8 +21,19 @@
<f:resource name="org.richfaces.renderkit.html.images.SliderArrowImage"
var="arrow" />
<f:resource
name="org.richfaces.renderkit.html.images.SliderArrowSelectedImage"
var="arrowSelected" />
+ <jsp:scriptlet>
+ <![CDATA[
+ String width = (String) component.getAttributes().get("width");
+ if (width == null || width.length() == 0) {
+ width = "200px";
+ } else {
+ width = HtmlUtil.qualifySize(width);
+ }
+ variables.setVariable("width", width);
+ ]]>
+ </jsp:scriptlet>
<table id="#{clientId}" border="0" cellpadding="0"
cellspacing="0" class="dr-insldr rich-slider
#{component.attributes['styleClass']}"
- style="#{style}"
x:passThruWithExclusions="id,boundClass,tipClass,class,width,height,style,border">
+ style="width: #{width};#{style}"
x:passThruWithExclusions="id,boundClass,tipClass,class,width,height,style,border">
<tbody>
<tr>
<jsp:scriptlet><![CDATA[
@@ -188,7 +201,8 @@
clientErrorMsg :
"#{component.attributes['clientErrorMessage']}",
<f:call name="writeEventHandlerFunction"><f:parameter
value="onslide" /></f:call>,
onchange : "#{component.attributes['onchange']}",
- required : #{component.attributes['required']}
+ required : #{component.attributes['required']},
+ width : "#{width}"
})
</script>
</td>