Tokentextarea: Fix block size error
authorMinkyeong Kim <minkyeong.kim@samsung.com>
Mon, 15 Apr 2013 09:18:13 +0000 (18:18 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Tue, 16 Apr 2013 04:38:21 +0000 (13:38 +0900)
Change-Id: I88c8e6cde8a44acc60584cc0ebf1d75800643a3b

src/js/widgets/jquery.mobile.tizen.tokentextarea.js

index 63d632e..5664459 100755 (executable)
@@ -309,8 +309,7 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                $view = self.element,
                                option = self.options,
                                inputbox = $view.find( ".ui-tokentextarea-input" ),
-                               moreBlock = $view.find( ".ui-tokentextarea-link-base" ),
-                               isSeparator = false;
+                               moreBlock = $view.find( ".ui-tokentextarea-link-base" );
 
                        // delegate a event to HTMLDivElement(each block).
                        $view.delegate( "div", "click", function ( event ) {
@@ -335,7 +334,8 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                var keyValue = event.keyCode,
                                        valueString = $( inputbox ).val(),
                                        valueStrings = [],
-                                       index;
+                                       index,
+                                       isSeparator = false;
 
                                if ( keyValue === 8 ) {
                                        if ( valueString.length === 0 ) {
@@ -378,7 +378,7 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                if ( $view.innerWidth() === 0 ) {
                                        return ;
                                }
-                               self._modifyInputBoxWidth();
+                               self.refresh();
                                $( inputbox ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" );
                        });
 
@@ -757,9 +757,11 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
 
                refresh : function () {
                        var self = this,
-                               $view = this.element;
+                               viewWidth = this.element.innerWidth();
 
-                       self._viewWidth = $view.innerWidth();
+                       if ( viewWidth && self._viewWidth !== viewWidth ) {
+                               self._viewWidth = viewWidth;
+                       }
                        self._resizeBlocks();
                        self._modifyInputBoxWidth();
                },