diff options
author | Ablay Keldibek <atomio.ak@gmail.com> | 2015-04-07 20:10:27 +0600 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-22 12:55:54 -0400 |
commit | 897a238332110c5c1a58ee9a0db5bf4e54fc3059 (patch) | |
tree | c157dbaf6d87ab9e3f871fb81c85c2c5582ef250 /ui | |
parent | ec952e2909113b45dab7ddaa817cb3766f39ba18 (diff) | |
download | jquery-ui-897a238332110c5c1a58ee9a0db5bf4e54fc3059.tar.gz jquery-ui-897a238332110c5c1a58ee9a0db5bf4e54fc3059.zip |
Slider: Range fills all space after changing orientation
Resets width/height of range
Fixes #12205
Closes gh-1533
Diffstat (limited to 'ui')
-rw-r--r-- | ui/slider.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/slider.js b/ui/slider.js index b40a35e66..131f93fb0 100644 --- a/ui/slider.js +++ b/ui/slider.js @@ -440,6 +440,9 @@ return $.widget( "ui.slider", $.ui.mouse, { this._removeClass( "ui-slider-horizontal ui-slider-vertical" ) ._addClass( "ui-slider-" + this.orientation ); this._refreshValue(); + if ( this.options.range ) { + this._refreshRange( value ); + } // Reset positioning from previous orientation this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); @@ -564,6 +567,15 @@ return $.widget( "ui.slider", $.ui.mouse, { return this.max; }, + _refreshRange: function ( orientation ) { + if ( orientation === "vertical" ) { + this.range.css( { "width": "", "left": "" } ); + } + if ( orientation === "horizontal" ) { + this.range.css( { "height": "", "bottom": "" } ); + } + }, + _refreshValue: function() { var lastValPercent, valPercent, value, valueMin, valueMax, oRange = this.options.range, |