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

Commit 15129eb

Browse files
Textinput: Allow to set option mini programmatically. Fixes #4070.
1 parent 7f6c0ac commit 15129eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/jquery.mobile.forms.textinput.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.widget", "./jquery.
1212
$.widget( "mobile.textinput", $.mobile.widget, {
1313
options: {
1414
theme: null,
15+
mini: false,
1516
// This option defaults to true on iOS devices.
1617
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
1718
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, {
2526
o = this.options,
2627
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
2728
themeclass = " ui-body-" + theme,
28-
mini = input.jqmData("mini") == true,
29-
miniclass = mini ? " ui-mini" : "",
29+
miniclass = o.mini ? " ui-mini" : "",
3030
focusedEl, clearbtn;
3131

3232
$( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
@@ -67,7 +67,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
6767
iconpos: "notext",
6868
corners: true,
6969
shadow: true,
70-
mini: mini
70+
mini: o.mini
7171
});
7272

7373
function toggleClear() {

0 commit comments

Comments
 (0)