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

Commit 698ffb2

Browse files
Textinput: Added option corners. Fixes #5610.
Also removed class ui-btn-shadow because we don't use that.
1 parent be2c475 commit 698ffb2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/widgets/forms/textinput.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
1212
$.widget( "mobile.textinput", $.mobile.widget, {
1313
options: {
1414
theme: null,
15+
corners: true,
1516
mini: false,
1617
// This option defaults to true on iOS devices.
1718
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
@@ -26,6 +27,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
2627
input = this.element,
2728
o = this.options,
2829
themeclass = " ui-body-" + ( o.theme ? o.theme : "inherit" ),
30+
cornerclass = o.corners ? " ui-corner-all" : "",
2931
miniclass = o.mini ? " ui-mini" : "",
3032
isSearch = input.is( "[type='search'], :jqmData(type='search')" ),
3133
isTextarea = input[ 0 ].tagName === "TEXTAREA",
@@ -66,7 +68,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
6668
if ( isSearch || inputNeedsWrap ) {
6769
classes = isSearch ? "ui-input-search" : "ui-input-text";
6870

69-
focusedEl = input.wrap( "<div class='" + classes + themeclass + miniclass + " ui-shadow-inset ui-corner-all ui-btn-shadow'></div>" ).parent();
71+
focusedEl = input.wrap( "<div class='" + classes + themeclass + miniclass + cornerclass + " ui-shadow-inset'></div>" ).parent();
7072
}
7173

7274

@@ -95,7 +97,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
9597

9698
input.bind( "paste cut keyup input focus change blur", toggleClear );
9799
} else if ( !inputNeedsWrap && !isSearch ) {
98-
input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
100+
input.addClass( "ui-shadow-inset" + themeclass + miniclass + cornerclass );
99101
}
100102

101103
input.focus(function() {

0 commit comments

Comments
 (0)