Skip to content
Browse files

Textinput: Allow to set option mini programmatically. Fixes #4070.

  • Loading branch information...
1 parent 7f6c0ac commit 15129ebe78fcf8d6e8b7e7b536c2793cc49c0dcd @jaspermdegroot jaspermdegroot committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 js/jquery.mobile.forms.textinput.js
View
6 js/jquery.mobile.forms.textinput.js
@@ -12,6 +12,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.widget", "./jquery.
$.widget( "mobile.textinput", $.mobile.widget, {
options: {
theme: null,
+ mini: false,
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
@@ -25,8 +26,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
o = this.options,
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
themeclass = " ui-body-" + theme,
- mini = input.jqmData("mini") == true,
- miniclass = mini ? " ui-mini" : "",
+ miniclass = o.mini ? " ui-mini" : "",
focusedEl, clearbtn;
$( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
@@ -67,7 +67,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
iconpos: "notext",
corners: true,
shadow: true,
- mini: mini
+ mini: o.mini
});
function toggleClear() {

0 comments on commit 15129eb

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