From: Youmin Ha Date: Sat, 19 Jan 2013 12:58:03 +0000 (+0900) Subject: demo: Adjust textarea height automatically X-Git-Tag: accepted/tizen_2.1/20130425.023924~7^2~176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cd7830a09e2eed7ebad820be3bcf099eaf6926a;p=platform%2Fframework%2Fweb%2Fweb-ui-fw.git demo: Adjust textarea height automatically Tizen browses does not set textarea height automatically, while chrome does it. So automatic textarea height calculation routine is added. Fixes N_SE-21257. Change-Id: I5f6eac0469f2c845d69495de26ce8f0805418698 --- diff --git a/demos/tizen-winsets/main.js b/demos/tizen-winsets/main.js index acf97bc..68faaa5 100755 --- a/demos/tizen-winsets/main.js +++ b/demos/tizen-winsets/main.js @@ -163,10 +163,23 @@ $( document ).bind("pagecreate", function () { // TODO: 'create' is called twice!! }); }); + + // Expand all textarea height automatically + $('#ButtonNolist').live( "pagecreate", function ( ev ) { + var page = $( ev.target ); + $( page ).bind( 'pageshow' , function ( ) { + var textarea = page.find('textarea'); + $( textarea ).each( function ( idx, el ) { + var h = Math.max( el.clientHeight, el.scrollHeight ); + $( el ).height( h ); + } ); + } ); + } ); + }); $(document).bind( "pageinit" , function() { - $.mobile.tizen.enableSelection($("div:jqmData(role='page')"), 'none'); + $.mobile.tizen.enableSelection( $("div:jqmData(role='page')"), 'none' ); }); $(document).ready( function () { // add current datetime with browser language format diff --git a/demos/tizen-winsets/widgets/button/buttonNolist.html b/demos/tizen-winsets/widgets/button/buttonNolist.html index 640eb69..a97ab4b 100644 --- a/demos/tizen-winsets/widgets/button/buttonNolist.html +++ b/demos/tizen-winsets/widgets/button/buttonNolist.html @@ -8,10 +8,12 @@ + + -
+

Buttons

@@ -87,6 +89,5 @@
-