}\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
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
}\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
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
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
filter: '',\r
opacity: ''\r
}).fadeOut( onFadeOutComplete );\r
+ currentOverlay.close();\r
this.visible = visible = false;\r
this.currentID = null;\r
},\r