mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
refactor for #509, move to document ready instead of using ssetTimeout
This commit is contained in:
parent
3306a3242c
commit
8dd3def54b
1 changed files with 7 additions and 5 deletions
|
|
@ -100,6 +100,9 @@ $.widget( "mobile.textinput", $.mobile.widget, {
|
|||
var scrollHeight = input[ 0 ].scrollHeight,
|
||||
clientHeight = input[ 0 ].clientHeight;
|
||||
|
||||
console.log( scrollHeight );
|
||||
console.log( clientHeight );
|
||||
|
||||
if ( clientHeight < scrollHeight ) {
|
||||
input.css({
|
||||
height: (scrollHeight + extraLineHeight)
|
||||
|
|
@ -112,12 +115,11 @@ $.widget( "mobile.textinput", $.mobile.widget, {
|
|||
clearTimeout( keyupTimeout );
|
||||
keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
|
||||
});
|
||||
// Issue 509: the browser is not giving scrollHeight properly until after this function has run, adding in a setTimeout
|
||||
// so we can properly access the scrollHeight
|
||||
|
||||
// Issue 509: the browser is not giving scrollHeight properly until after the document
|
||||
// is ready.
|
||||
if ($.trim(input.text())) {
|
||||
setTimeout( function() {
|
||||
keyup();
|
||||
}, 0 );
|
||||
$(keyup);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue