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

Commit e2a8de6

Browse files
committed
Textinput: Update autogrow to auto shrink as well. Clearinput update for new css
1 parent 7c3d76f commit e2a8de6

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

css/structure/jquery.mobile.forms.textinput.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ textarea.ui-input-text {
3333
height: 3.125em;
3434
overflow: auto;
3535
resize: vertical;
36-
-webkit-transition: height 200ms linear;
37-
-moz-transition: height 200ms linear;
38-
-o-transition: height 200ms linear;
39-
transition: height 200ms linear;
4036
}
4137
.ui-mini .ui-input-text input,
4238
.ui-mini .ui-input-search input,

demos/widgets/textinputs/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<div data-demo-html="true">
5656
<form>
5757
<label for="textarea-1">Textarea:</label>
58-
<textarea cols="40" rows="8" name="textarea-1" id="textarea-1"></textarea>
58+
<textarea name="textarea-1" id="textarea-1"></textarea>
5959
</form>
6060
</div><!-- /demo-html -->
6161

js/widgets/forms/autogrow.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,14 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
6060
},
6161

6262
_updateHeight:function(){
63-
var paddingTop, paddingBottom, paddingHeight,
64-
scrollHeight = this.element[ 0 ].scrollHeight,
65-
clientHeight = this.element[ 0 ].clientHeight;
66-
67-
68-
if ( clientHeight < scrollHeight ) {
69-
paddingTop = parseFloat( this.element.css( "padding-top" ) );
70-
paddingBottom = parseFloat( this.element.css( "padding-bottom" ) );
71-
paddingHeight = paddingTop + paddingBottom;
72-
73-
this.element.height( scrollHeight - paddingHeight + 15 );
74-
}
63+
64+
this.element.css({
65+
height: "auto"
66+
});
67+
this.element.css({
68+
height: this.element[0].scrollHeight + 15 + "px"
69+
});
70+
7571
},
7672
_setOptions: function( o ){
7773
this._super( o );

js/widgets/forms/clearButton.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
2727

2828
var o = this.options;
2929

30-
return $( "<a href='#' class='ui-input-clear ui-btn ui-icon-delete ui-btn-icon-notext" +
31-
" ui-corner-all ui-shadow " +
32-
( o.theme ? "ui-btn-" + o.theme : "" ) +
33-
( o.mini ? "ui-mini" : "" ) + "' title='" + o.clearBtnText + "'>" + o.clearBtnText + "</a>" );
30+
return $( "<a href='#' class='ui-input-clear ui-btn ui-icon-delete ui-btn-icon-notext ui-corner-all" +
31+
"' title='" + o.clearBtnText + "'>" + o.clearBtnText + "</a>" );
3432

3533
},
3634

0 commit comments

Comments
 (0)