Skip to content
Browse files

revert slider changes, for further review

  • Loading branch information...
1 parent 25dcde3 commit a47daa061427aeb17e0790fbe734fab9d413f4b6 @johnbender johnbender committed Feb 14, 2012
Showing with 11 additions and 20 deletions.
  1. +11 −20 js/jquery.mobile.forms.slider.js
View
31 js/jquery.mobile.forms.slider.js
@@ -101,34 +101,25 @@ $.widget( "mobile.slider", $.mobile.widget, {
});
if ( cType == "select" ) {
- var wrapper = document.createElement('div');
- wrapper.className = 'ui-slider-inneroffset';
- for(var j = 0,length = domSlider.childNodes.length;j < length;j++){
- wrapper.appendChild(domSlider.childNodes[j]);
- }
- domSlider.appendChild(wrapper);
+
+ slider.wrapInner( "<div class='ui-slider-inneroffset'></div>" );
// make the handle move with a smooth transition
handle.addClass( "ui-slider-handle-snapping" );
options = control.find( "option" );
- for(var i = 0, length = options.length; i < length; i++){
+ control.find( "option" ).each(function( i ) {
+
var side = !i ? "b":"a",
- corners = !i ? "right" :"left",
- sliderTheme = !i ? " ui-btn-down-" + trackTheme :( " " + $.mobile.activeBtnClass ),
- sliderLabel = document.createElement('div'),
- sliderImg = document.createElement('span');
-
- sliderLabel.className = ['ui-slider-labelbg ui-slider-labelbg-',side,sliderTheme," ui-btn-corner-",corners].join("");
- $(sliderLabel).prependTo( slider );
- sliderImg.className = ['ui-slider-label ui-slider-label-',side,sliderTheme," ui-btn-corner-",corners].join("");
- sliderImg.setAttribute('role','img');
- sliderImg.appendChild(document.createTextNode(options[i].innerHTML));
- $(sliderImg).prependTo( handle );
- }
+ theme = !i ? " ui-btn-down-" + trackTheme :( " " + $.mobile.activeBtnClass );
+
+ $( "<span class='ui-slider-label ui-slider-label-" + side + theme + " ui-btn-corner-all' role='img'>" + $( this ).getEncodedText() + "</span>" )
+ .prependTo( slider );
+ });
+
+ self._labels = $( ".ui-slider-label", slider );
- self._labels = $( ".ui-slider-label", slider );
}
label.addClass( "ui-slider" );

0 comments on commit a47daa0

Please sign in to comment.
Something went wrong with that request. Please try again.