OSDN Git Service

fixed overlay.hide()
authoritozyun <itozyun@gmail.com>
Tue, 17 Apr 2012 12:49:17 +0000 (21:49 +0900)
committeritozyun <itozyun@gmail.com>
Tue, 17 Apr 2012 12:49:17 +0000 (21:49 +0900)
public/assets/common.js

index 5369fd7..23649d6 100644 (file)
@@ -880,10 +880,7 @@ pettanr.view = ( function(){
                }\r
                this.close = function(){\r
                        if( this.onClose() === false ){\r
-                               return;\r
-                       }\r
-                       if( this.rootElement && this.rootElement.parentNode ){\r
-                               this.rootElement.parentNode.removeChild( this.rootElement );\r
+                               return false;\r
                        }\r
                }\r
                this.onOpen = function( _w, _h /*, _option */ ){\r
@@ -915,7 +912,6 @@ pettanr.view = ( function(){
                this.shutdown = function(){\r
                        if( this.inOverlay === true ){\r
                                pettanr.overlay.hide();\r
-                               application.close();\r
                                this.inOverlay = false;\r
                        } else {\r
                                bootApplication( 0 );\r
@@ -974,7 +970,12 @@ pettanr.view = ( function(){
                }\r
                \r
                if( currentApplication === _application ) return;\r
-               currentApplication && currentApplication.close();\r
+               if( currentApplication ){\r
+                       currentApplication.close();\r
+                       currentApplication.rootElement && currentApplication.rootElement.parentNode &&\r
+                               currentApplication.rootElement.parentNode.removeChild( currentApplication.rootElement );\r
+               }\r
+                       \r
                currentApplication = _application;\r
                \r
                if( _application.nextSibling && _application.nextSibling.parentNode === _application.parentElement ){\r
@@ -1081,15 +1082,11 @@ pettanr.overlay = ( function(){
                visible = false,\r
                windowW, windowH;\r
 \r
-       function close(){\r
-               currentOverlay && currentOverlay.close();\r
-               pettanr.overlay.hide();\r
-       }\r
        function asyncResize(){\r
                currentOverlay.resize( windowW, windowH);\r
        }\r
        function onCloseClick( e){\r
-               close();\r
+               pettanr.overlay.hide();\r
                e.preventDefault();\r
                return false;           \r
        }\r
@@ -1109,7 +1106,7 @@ pettanr.overlay = ( function(){
                        jqShadow = $( '#overlay-shadow');\r
                        jqCloseButton = $( '#overlay-close-button').click( onCloseClick );\r
                        \r
-                       pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, close); // 27.esc\r
+                       pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, pettanr.overlay.hide ); // 27.esc\r
                        \r
                        delete pettanr.overlay.init;\r
                },\r
@@ -1146,6 +1143,7 @@ pettanr.overlay = ( function(){
                                filter:         '',\r
                                opacity:        ''\r
                        }).fadeOut( onFadeOutComplete );\r
+                       currentOverlay.close();\r
                        this.visible = visible = false;\r
                        this.currentID = null;\r
                },\r