Permalink
Browse files

Textinput: Update autogrow to auto shrink as well. Clearinput update …

…for new css
  • Loading branch information...
arschmitz committed Jul 2, 2013
1 parent 7c3d76f commit e2a8de6e803d411c9a4c9dd2b15bcb2d281312c6
@@ -33,10 +33,6 @@ textarea.ui-input-text {
height: 3.125em;
overflow: auto;
resize: vertical;
-webkit-transition: height 200ms linear;
-moz-transition: height 200ms linear;
-o-transition: height 200ms linear;
transition: height 200ms linear;
}
.ui-mini .ui-input-text input,
.ui-mini .ui-input-search input,
@@ -55,7 +55,7 @@
<div data-demo-html="true">
<form>
<label for="textarea-1">Textarea:</label>
<textarea cols="40" rows="8" name="textarea-1" id="textarea-1"></textarea>
<textarea name="textarea-1" id="textarea-1"></textarea>
</form>
</div><!-- /demo-html -->
@@ -60,18 +60,14 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
},
_updateHeight:function(){
var paddingTop, paddingBottom, paddingHeight,
scrollHeight = this.element[ 0 ].scrollHeight,
clientHeight = this.element[ 0 ].clientHeight;
if ( clientHeight < scrollHeight ) {
paddingTop = parseFloat( this.element.css( "padding-top" ) );
paddingBottom = parseFloat( this.element.css( "padding-bottom" ) );
paddingHeight = paddingTop + paddingBottom;
this.element.height( scrollHeight - paddingHeight + 15 );
}
this.element.css({
height: "auto"
});
this.element.css({
height: this.element[0].scrollHeight + 15 + "px"
});
},
_setOptions: function( o ){
this._super( o );
@@ -27,10 +27,8 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
var o = this.options;
return $( "<a href='#' class='ui-input-clear ui-btn ui-icon-delete ui-btn-icon-notext" +
" ui-corner-all ui-shadow " +
( o.theme ? "ui-btn-" + o.theme : "" ) +
( o.mini ? "ui-mini" : "" ) + "' title='" + o.clearBtnText + "'>" + o.clearBtnText + "</a>" );
return $( "<a href='#' class='ui-input-clear ui-btn ui-icon-delete ui-btn-icon-notext ui-corner-all" +
"' title='" + o.clearBtnText + "'>" + o.clearBtnText + "</a>" );
},

4 comments on commit e2a8de6

@jhogervorst

This comment has been minimized.

Show comment
Hide comment
@jhogervorst

jhogervorst Jul 16, 2013

Contributor

@arschmitz I'd like to test it and give feedback (as you mentioned). However, currently the auto grow is not working at all (test page).

Contributor

jhogervorst replied Jul 16, 2013

@arschmitz I'd like to test it and give feedback (as you mentioned). However, currently the auto grow is not working at all (test page).

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Jul 16, 2013

Member

hmmm working here http://view.jquerymobile.com/master/demos/widgets/textinputs/ will have to look at your test page

Member

arschmitz replied Jul 16, 2013

hmmm working here http://view.jquerymobile.com/master/demos/widgets/textinputs/ will have to look at your test page

@jhogervorst

This comment has been minimized.

Show comment
Hide comment
@jhogervorst

jhogervorst Jul 16, 2013

Contributor

@arschmitz Thanks for the URL, it's working there indeed. There are some issues in the current solution, I could fix that. Shall I open an issue describing the issues and send a pull request?

Contributor

jhogervorst replied Jul 16, 2013

@arschmitz Thanks for the URL, it's working there indeed. There are some issues in the current solution, I could fix that. Shall I open an issue describing the issues and send a pull request?

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Jul 16, 2013

Member

feel free to open an issue and we will look at it

Member

arschmitz replied Jul 16, 2013

feel free to open an issue and we will look at it

Please sign in to comment.