move pagechange binding for textarea autogrow outside the check for text content

This commit is contained in:
John Bender 2011-11-21 10:15:47 -08:00
parent e918442bbb
commit 6f00d35db8

View file

@ -96,15 +96,15 @@ $.widget( "mobile.textinput", $.mobile.widget, {
keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
});
// binding to pagechange here ensures that for pages loaded via
// ajax the height is recalculated without user input
$( document ).one( "pagechange", keyup );
// Issue 509: the browser is not providing scrollHeight properly until the styles load
if ( $.trim( input.val() ) ) {
// bind to the window load to make sure the height is calculated based on BOTH
// the DOM and CSS
$( window ).load( keyup );
// binding to pagechange here ensures that for pages loaded via
// ajax the height is recalculated without user input
$( document ).one( "pagechange", keyup );
}
}
},