From 0a652683cdce3eb705c78af35cb4a900f776062c Mon Sep 17 00:00:00 2001 From: itozyun Date: Tue, 17 Apr 2012 21:49:17 +0900 Subject: [PATCH] fixed overlay.hide() --- public/assets/common.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/public/assets/common.js b/public/assets/common.js index 5369fd75..23649d6f 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -880,10 +880,7 @@ pettanr.view = ( function(){ } this.close = function(){ if( this.onClose() === false ){ - return; - } - if( this.rootElement && this.rootElement.parentNode ){ - this.rootElement.parentNode.removeChild( this.rootElement ); + return false; } } this.onOpen = function( _w, _h /*, _option */ ){ @@ -915,7 +912,6 @@ pettanr.view = ( function(){ this.shutdown = function(){ if( this.inOverlay === true ){ pettanr.overlay.hide(); - application.close(); this.inOverlay = false; } else { bootApplication( 0 ); @@ -974,7 +970,12 @@ pettanr.view = ( function(){ } if( currentApplication === _application ) return; - currentApplication && currentApplication.close(); + if( currentApplication ){ + currentApplication.close(); + currentApplication.rootElement && currentApplication.rootElement.parentNode && + currentApplication.rootElement.parentNode.removeChild( currentApplication.rootElement ); + } + currentApplication = _application; if( _application.nextSibling && _application.nextSibling.parentNode === _application.parentElement ){ @@ -1081,15 +1082,11 @@ pettanr.overlay = ( function(){ visible = false, windowW, windowH; - function close(){ - currentOverlay && currentOverlay.close(); - pettanr.overlay.hide(); - } function asyncResize(){ currentOverlay.resize( windowW, windowH); } function onCloseClick( e){ - close(); + pettanr.overlay.hide(); e.preventDefault(); return false; } @@ -1109,7 +1106,7 @@ pettanr.overlay = ( function(){ jqShadow = $( '#overlay-shadow'); jqCloseButton = $( '#overlay-close-button').click( onCloseClick ); - pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, close); // 27.esc + pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, pettanr.overlay.hide ); // 27.esc delete pettanr.overlay.init; }, @@ -1146,6 +1143,7 @@ pettanr.overlay = ( function(){ filter: '', opacity: '' }).fadeOut( onFadeOutComplete ); + currentOverlay.close(); this.visible = visible = false; this.currentID = null; }, -- 2.11.0