From 897a238332110c5c1a58ee9a0db5bf4e54fc3059 Mon Sep 17 00:00:00 2001 From: Ablay Keldibek Date: Tue, 7 Apr 2015 20:10:27 +0600 Subject: Slider: Range fills all space after changing orientation Resets width/height of range Fixes #12205 Closes gh-1533 --- ui/slider.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ui') 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, -- cgit v1.2.3