Author: konstantin.mishin
Date: 2010-09-17 13:53:39 -0400 (Fri, 17 Sep 2010)
New Revision: 19246
Modified:
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
branches/RF-9151/ui/input/ui/src/main/templates/inputnumberspinner.template.xml
Log:
RF-9195
Modified:
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss
===================================================================
---
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss 2010-09-17
17:52:10 UTC (rev 19245)
+++
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.ecss 2010-09-17
17:53:39 UTC (rev 19246)
@@ -20,43 +20,61 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
.rf-insp {
- border: 1px solid #A6A6A6/*panelBorderColor*/;
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
display: inline-block;
- background: url("#{resource['bg_field.png']}") top left
repeat-x;/*gradient - from additionalBackgroundColor to controlBackgroundColor,
background-color - controlBackgroundColor*/;
+ font-size: 1px;
white-space: nowrap;
- font-size: 1px;
}
-input[type="text"].rf-insp-inp {
- vertical-align: top;
- color: #000000;/*generalTextColor*/
+input.rf-insp-inp[type="text"] {
+ background-color: '#{richSkin.controlBackgroundColor}';
+ background-imaage:
url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}");
+ background-position:1px 1px;
+ background-repeat:no-repeat;
border: 0px;
- background: none;
+ color: '#{richSkin.generalTextColor}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
margin: 0px;
padding: 0px;
+ vertical-align: top;
}
.rf-insp-btna {
+ background-color: '#{richSkin.headerBackgroundColor}';
+ background-image:
"url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})";
+ background-position: top left;
+ background-repeat: repeat-x;
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-left-color: '#{richSkin.panelBorderColor}';
+ display: inline-block;
vertical-align: top;
- background: url("#{resource['bg_btn.png']}") top left repeat-x
#C0D1E7/*gradient - from headerGradientColor to headerBackgroundColor, background-color -
headerBackgroundColor*/;
- border-left: 1px solid #A6A6A6/*panelBorderColor*/;
- width: 16px;
- height: 15px;
- display: inline-block;
}
-.rf-insp-dbtn {
+
+.rf-insp-dbtn, .rf-insp-ibtn, .rf-insp-dbtn-dis, .rf-insp-ibtn-dis {
+ background-position: 50% 40%;
+ background-repeat: no-repeat;
display: block;
- height: 7px;
- background-image: url("#{resource['button_down.gif']}");
+ height: 8px;
width: 15px;
- padding-top: 1px;
}
+.rf-insp-dbtn {
+ background-image:
url("#{resource['org.richfaces.renderkit.html.images.SpinnerArrowBottom']}");
+}
+
.rf-insp-ibtn {
- display: block;
- height: 7px;
- background-image: url("#{resource['button_up.gif']}");
- width: 15px;
- padding-top: 1px;
+ background-image:
url("#{resource['org.richfaces.renderkit.html.images.SpinnerArrowTop']}");
+}
+
+.rf-insp-dbtn-dis {
+ background-image:
url("#{resource['org.richfaces.renderkit.html.images.SpinnerDisabledArrowBottom']}");
+}
+
+.rf-insp-ibtn-dis {
+ background-image:
url("#{resource['org.richfaces.renderkit.html.images.SpinnerDisabledArrowTop']}");
}
\ No newline at end of file
Modified:
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js
===================================================================
---
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js 2010-09-17
17:52:10 UTC (rev 19245)
+++
branches/RF-9151/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSpinner.js 2010-09-17
17:53:39 UTC (rev 19246)
@@ -26,6 +26,7 @@
name: "InputNumberSpinner",
+ cycled: true,
delay: 200,
maxValue: 100,
minValue: 0,
@@ -55,11 +56,19 @@
},
decrease: function (event) {
- this.setValue(this.value - this.step);
+ var value = this.value - this.step;
+ if (value < this.minValue && this.cycled) {
+ value = this.maxValue;
+ }
+ this.setValue(value);
},
increase: function (event) {
- this.setValue(this.value + this.step);
+ var value = this.value + this.step;
+ if (value > this.maxValue && this.cycled) {
+ value = this.minValue;
+ }
+ this.setValue(value);
},
getValue: function () {
@@ -113,7 +122,7 @@
component.decrease();
}, this.delay);
jQuery(document).one("mouseup", true, jQuery.proxy(this.__clearInterval,
this));
- this.decreaseButton.css("backgroundPosition", "60% 55%");
+ this.decreaseButton.css("backgroundPosition", "60% 60%");
event.preventDefault();
},
@@ -124,7 +133,7 @@
component.increase();
}, this.delay);
jQuery(document).one("mouseup",jQuery.proxy(this.__clearInterval,
this));
- this.increaseButton.css("backgroundPosition", "60% 55%");
+ this.increaseButton.css("backgroundPosition", "60% 60%");
event.preventDefault();
},
Modified: branches/RF-9151/ui/input/ui/src/main/templates/inputnumberspinner.template.xml
===================================================================
---
branches/RF-9151/ui/input/ui/src/main/templates/inputnumberspinner.template.xml 2010-09-17
17:52:10 UTC (rev 19245)
+++
branches/RF-9151/ui/input/ui/src/main/templates/inputnumberspinner.template.xml 2010-09-17
17:53:39 UTC (rev 19246)
@@ -42,10 +42,11 @@
class="rf-insp-inp #{component.attributes['inputClass']}"
value="#{getInputValue(facesContext, component)}"
cdk:passThrough="accesskey disabled maxlength size:inputSize tabindex"
readonly="#{!component.attributes['enableManualInput']}" />
<span class="rf-insp-btna">
- <span class="rf-insp-ibtn" />
- <span class="rf-insp-dbtn" />
+ <span class="rf-insp-ibtn#{component.attributes['disabled'] ?
'-dis' : ''}" />
+ <span class="rf-insp-dbtn#{component.attributes['disabled'] ?
'-dis' : ''}" />
</span>
<script type="text/javascript">new
RichFaces.ui.InputNumberSpinner('#{clientId}', {
+ cycled: #{component.attributes['cycled']},
maxValue: #{component.attributes['maxValue']},
minValue: #{component.attributes['minValue']},
step: #{component.attributes['step']}