Replaced expandable plugin with basic scrollHeight vs. offsetHeight check that uses CSS transitions. Shaves about 4kb.

This commit is contained in:
scottjehl 2010-09-22 11:08:51 -04:00
parent cdac24a168
commit da29904834
3 changed files with 6 additions and 3 deletions

View file

@ -5,7 +5,7 @@
*/
label.ui-input-text, .ui-controlgroup-label { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; }
input.ui-input-text, textarea.ui-input-text { padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 95%; }
textarea.ui-input-text { height: 50px; }
textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; -moz-transition: height 200ms linear; -o-transition: height 200ms linear; transition: height 200ms linear; }
.ui-input-search { margin: 5px; padding: 0 0 0 30px; background-position: 6px 50%; background-repeat: no-repeat; }
.ui-input-search input.ui-input-text { border: none; width: 98%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; }

View file

@ -36,7 +36,11 @@ jQuery.fn.customTextInput = function(options){
//autogrow
if(input.is('textarea')){
input.expandable();
input.keydown(function(){
if( input[0].offsetHeight < input[0].scrollHeight ){
input.css({height: input[0].scrollHeight + 10 });
}
})
}
});
};

View file

@ -8,7 +8,6 @@ $elements = array(
'jQuery.mobile.clickable.js',
'jQuery.mobile.fixHeaderFooter.js',
'jQuery.mobile.forms.checkboxradio.js',
'jQuery.mobile.forms.expandable.js',
'jQuery.mobile.forms.textinput.js',
'jQuery.mobile.forms.select.js',
'jQuery.mobile.forms.ajaxform.js',