aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-02-21 11:40:05 +0000
committerRichard Worth <rdworth@gmail.com>2009-02-21 11:40:05 +0000
commit3342fb841a007f8e4769793c69c683e9ab6fbdcf (patch)
treec4fe6e6454aec0eaa96e73de32ac3e721978fc24
parentbf43ab6d30846b1ac856ae5c033019f50fe3a152 (diff)
downloadjquery-ui-3342fb841a007f8e4769793c69c683e9ab6fbdcf.tar.gz
jquery-ui-3342fb841a007f8e4769793c69c683e9ab6fbdcf.zip
Slider: Fixed min and max range sliders to add ui-slider-range-min or ui-slider-range-max class and not set corresponding left/right/top/bottom inline, only width/height
(fixes #4182 - slider min/max classes aren't being added to range div) (fixes #3850 - Slider Range With Fixed Max Demo Bug in Opera)
-rw-r--r--ui/ui.slider.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/ui/ui.slider.js b/ui/ui.slider.js
index b304843bf..ff7d1ce0c 100644
--- a/ui/ui.slider.js
+++ b/ui/ui.slider.js
@@ -46,13 +46,15 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
this.range
.appendTo(this.element)
- .addClass("ui-slider-range"
- + " ui-widget-header");
+ .addClass("ui-slider-range");
- (o.range == "min") && (this.orientation == "horizontal") && this.range.css({ left : 0 });
- (o.range == "max") && (this.orientation == "horizontal") && this.range.css({ right : 0 });
- (o.range == "min") && (this.orientation == "vertical") && this.range.css({ bottom : 0 });
- (o.range == "max") && (this.orientation == "vertical") && this.range.css({ top : 0 });
+ if (o.range == "min" || o.range == "max") {
+ this.range.addClass("ui-slider-range-" + o.range);
+ }
+
+ // note: this isn't the most fittingly semantic framework class for this element,
+ // but worked best visually with a variety of themes
+ this.range.addClass("ui-widget-header");
}
@@ -464,10 +466,10 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%';
this.handle.stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate);
- (oRange == "min") && (this.orientation == "horizontal") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ left: 0, width: valPercent + '%' }, o.animate);
- (oRange == "max") && (this.orientation == "horizontal") && this.range[animate ? 'animate' : 'css']({ left: valPercent + '%', width: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
- (oRange == "min") && (this.orientation == "vertical") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ top: (100 - valPercent) + '%', height: valPercent + '%' }, o.animate);
- (oRange == "max") && (this.orientation == "vertical") && this.range[animate ? 'animate' : 'css']({ bottom: valPercent + '%', height: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
+ (oRange == "min") && (this.orientation == "horizontal") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ width: valPercent + '%' }, o.animate);
+ (oRange == "max") && (this.orientation == "horizontal") && this.range[animate ? 'animate' : 'css']({ width: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
+ (oRange == "min") && (this.orientation == "vertical") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ height: valPercent + '%' }, o.animate);
+ (oRange == "max") && (this.orientation == "vertical") && this.range[animate ? 'animate' : 'css']({ height: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
}
},