Permalink
Browse files

Prevent the slider number input from being wrapped in a div.

  • Loading branch information...
1 parent 70103a5 commit c924ed46cad6091c809cb7fef66eb447d319dbcb @jaspermdegroot jaspermdegroot committed Dec 1, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 js/widgets/forms/textinput.js
@@ -35,7 +35,8 @@ $.widget( "mobile.textinput", $.mobile.widget, {
clearbtn,
clearBtnText = o.clearSearchButtonText || o.clearBtnText,
clearBtnBlacklist = input.is( "textarea, :jqmData(type='range')" ),
- inputNeedsClearBtn = !!o.clearBtn && !clearBtnBlacklist;
+ inputNeedsClearBtn = !!o.clearBtn && !clearBtnBlacklist,
+ inputNeedsWrap = input.is( "input" ) && !input.is( ":jqmData(type='range')" );
function toggleClear() {
setTimeout( function() {
@@ -64,7 +65,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
//"search" and "text" input widgets
if ( isSearch ) {
focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + themeclass + miniclass + "'></div>" ).parent();
- } else if ( input.is( "input" ) ) {
+ } else if ( inputNeedsWrap ) {
focusedEl = input.wrap( "<div class='ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + miniclass + "'></div>" ).parent();
}
@@ -91,7 +92,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
input.bind( "paste cut keyup focus change blur", toggleClear );
}
- else if ( input.is( "textarea" ) ) {
+ else if ( !inputNeedsWrap && !isSearch ) {
input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
}

0 comments on commit c924ed4

Please sign in to comment.