From 6cd7830a09e2eed7ebad820be3bcf099eaf6926a Mon Sep 17 00:00:00 2001 From: Youmin Ha Date: Sat, 19 Jan 2013 21:58:03 +0900 Subject: [PATCH] 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 --- demos/tizen-winsets/main.js | 15 ++++++++++++++- demos/tizen-winsets/widgets/button/buttonNolist.html | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) 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 @@
- -- 2.7.4