OSDN Git Service

bugfix at TailOperator & PanelElementConsole.del.
authoritozyun <itozyun@gmail.com>
Sun, 2 Dec 2012 23:59:42 +0000 (08:59 +0900)
committeritozyun <itozyun@gmail.com>
Sun, 2 Dec 2012 23:59:42 +0000 (08:59 +0900)
0.5.x/javascripts/peta.apps.js

index b50ff14..da5d5a0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.26
+ *   version 0.5.27
  *   
  * author:
  *   itozyun
@@ -2690,9 +2690,13 @@ var Editor = gOS.registerApplication( function(){
                                 * visibilityのほうがいい, display:none だと ie で描画が狂う
                                 */
                                styleMover.visibility = '';
-                               TailOperator.update( _currentText.w, _currentText.h, _currentText.a );
                                currentText = _currentText;
+                               TailOperator.update( _currentText.w, _currentText.h, _currentText.a );
                        },
+                       hide: function(){
+                               styleMover.visibility = 'hidden';
+                               currentText = null;
+                       },                      
                        hitTest: function( _mouseX, _mouseY ){
                                var _x  = tailX -SIZE / 2,
                                        _y  = tailY -SIZE / 2,
@@ -2700,17 +2704,12 @@ var Editor = gOS.registerApplication( function(){
                                ret === true && app.updateCoursor( 'move' );
                                return ret;
                        },
-                       hide: function(){
-                               styleMover.visibility = 'hidden';
-                               currentText = null;
-                       },
                        onStart: function( _mouseX, _mouseY ){
                                if( currentText.type !== PANEL_ELEMENT_TYPE_TEXT ) return false;
                                if( TailOperator.hitTest( _mouseX, _mouseY ) === true ){
                                        w = currentText.w;
                                        h = currentText.h;
-                                       currentText = currentText;
-                                       startA      = currentText.a;
+                                       startA = currentText.a;
                                        return true;
                                };
                                return false;
@@ -2729,12 +2728,10 @@ var Editor = gOS.registerApplication( function(){
                        onFinish: function(){
                                startA !== currentText.a && PanelElementOperatorManager.saveStatus( undefined, undefined, w, h, startA );
                                startA !== currentText.a && PanelElementOperatorManager.resize( undefined, undefined, w, h, currentText.a );
-                               currentText = null;
                        },
                        onCancel: function(){
                                currentText.angle( startA );
                                PanelElementOperatorManager.resize( undefined, undefined, w, h, startA );
-                               currentText = null;
                        }
                }
        })();
@@ -3051,6 +3048,9 @@ var Editor = gOS.registerApplication( function(){
                        show : function( _currentElement ){
                                currentElement = _currentElement;
                        },
+                       hide : function(){
+                               currentElement = null;
+                       },
                        onStart: function( _mouseX, _mouseY ){
                                offsetX = _mouseX;
                                offsetY = _mouseY;
@@ -3111,7 +3111,7 @@ var Editor = gOS.registerApplication( function(){
                                PositionOperator.onStart( x, y );
                                currentOperator = PositionOperator;
                        };
-                       return true;
+                       // return true;
                };
                function mousemove( e ){
                        var x = e.layerX - HIT_AREA / 2 - 5,
@@ -3205,6 +3205,7 @@ var Editor = gOS.registerApplication( function(){
                                app.updateCoursor( '' );
                                TailOperator.hide();
                                ResizeOperator.hide();
+                               PositionOperator.hide();
                                CONSOLE_CONTROLER.hide();
                        },
                        resizeElement : function( _x, _y, _w, _h, _angle ){
@@ -3304,8 +3305,8 @@ var Editor = gOS.registerApplication( function(){
                function del(){
                        if( currentElement === null ) return;
                        HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.restore, [ true, currentElement ], [ false, currentElement ], false ); // true
-                       PanelElementOperatorManager.hide();
                        PANEL_ELEMENT_CONTROL.remove( currentElement );
+                       PanelElementOperatorManager.hide();
                };
                function edit(){
                        if( currentElement === null || currentElement.type !== PANEL_ELEMENT_TYPE_TEXT ) return;