mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-05 13:14:45 +00:00
Replaced expandable plugin with basic scrollHeight vs. offsetHeight check that uses CSS transitions. Shaves about 4kb.
This commit is contained in:
parent
cdac24a168
commit
da29904834
3 changed files with 6 additions and 3 deletions
|
|
@ -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; }
|
||||
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue