Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Slider: Removed JS and CSS for option inline that does not exist.
Browse files Browse the repository at this point in the history
Inline has never been documented as an option and is not in the options object. No need to add this option because it is simple enough and more flexible to set display inline-block and width for ui-slider in your custom CSS.
  • Loading branch information
jaspermdegroot committed Dec 20, 2012
1 parent 5370652 commit 130932f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions css/structure/jquery.mobile.forms.slider.css
Expand Up @@ -40,8 +40,6 @@ div.ui-slider-switch.ui-mini a.ui-slider-handle .ui-btn-inner { height: 30px; wi
span.ui-slider-label-a { z-index: 1; left: 0; text-indent: -1.5em; }
span.ui-slider-label-b { z-index: 0; right: 0; text-indent: 1.5em;}

.ui-slider-inline { width: 120px; display: inline-block; }

@media all and (min-width: 28em){
.ui-field-contain label.ui-slider { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
.ui-field-contain div.ui-slider { display: inline-block; width: 78%; }
Expand Down
5 changes: 2 additions & 3 deletions js/widgets/forms/slider.js
Expand Up @@ -40,7 +40,6 @@ $.widget( "mobile.slider", $.mobile.widget, {
min = !this.isToggleSwitch ? parseFloat( control.attr( "min" ) ) : 0,
max = !this.isToggleSwitch ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length-1,
step = window.parseFloat( control.attr( "step" ) || 1 ),
inlineClass = ( this.options.inline || control.jqmData( "inline" ) === true ) ? " ui-slider-inline" : "",
miniClass = ( this.options.mini || control.jqmData( "mini" ) ) ? " ui-mini" : "",
domHandle = document.createElement( "a" ),
handle = $( domHandle ),
Expand All @@ -56,7 +55,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
this.element.addClass("ui-mini");
domHandle.setAttribute( "href", "#" );
domSlider.setAttribute( "role", "application" );
domSlider.className = ["ui-slider-app ",selectClass," ui-btn-down-",trackTheme," ui-btn-corner-all", inlineClass, miniClass].join( "" );
domSlider.className = ["ui-slider-app ",selectClass," ui-btn-down-",trackTheme," ui-btn-corner-all", miniClass].join( "" );
domHandle.className = "ui-slider-handle";
domSlider.appendChild( domHandle );

Expand Down Expand Up @@ -358,7 +357,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
theme = this.options.theme || parentTheme,
trackTheme = this.options.trackTheme || parentTheme;

self.slider[0].className = ['ui-slider-app ', ( this.isToggleSwitch ) ? "ui-slider-switch" : ""," ui-btn-down-" + trackTheme,' ui-btn-corner-all', ( this.options.inline ) ? " ui-slider-inline" : "", ( this.options.mini ) ? " ui-mini":""].join( "" );
self.slider[0].className = ['ui-slider-app ', ( this.isToggleSwitch ) ? "ui-slider-switch" : ""," ui-btn-down-" + trackTheme,' ui-btn-corner-all', ( this.options.mini ) ? " ui-mini":""].join( "" );
if ( this.options.disabled || this.element.attr( "disabled" ) ) {
this.disable();
}
Expand Down

0 comments on commit 130932f

Please sign in to comment.