From c924ed46cad6091c809cb7fef66eb447d319dbcb Mon Sep 17 00:00:00 2001 From: Jasper de Groot Date: Sat, 1 Dec 2012 11:53:51 +0100 Subject: [PATCH] Prevent the slider number input from being wrapped in a div. --- js/widgets/forms/textinput.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/widgets/forms/textinput.js b/js/widgets/forms/textinput.js index bb0d460f2e3..4967e388ef3 100644 --- a/js/widgets/forms/textinput.js +++ b/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( "" ).parent(); - } else if ( input.is( "input" ) ) { + } else if ( inputNeedsWrap ) { focusedEl = input.wrap( "
" ).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 ); }