OSDN Git Service

version 0.5.22, bugfix around Overlay.hide().
authoritozyun <itozyun@gmail.com>
Thu, 15 Nov 2012 13:31:21 +0000 (22:31 +0900)
committeritozyun <itozyun@gmail.com>
Thu, 15 Nov 2012 13:31:21 +0000 (22:31 +0900)
0.5.x/javascripts/peta.apps.js
0.5.x/javascripts/system.js

index 606c1a0..42aa5c6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.20
+ *   version 0.5.22
  *   
  * author:
  *   itozyun
@@ -539,6 +539,7 @@ var Gallery = gOS.registerApplication( function(){
        var self         = this,
                finder       = null,
                tree         = null,
+               nodeClose    = null,
                nodePath     = null,
                nodeBody     = null,
                headerH      = 0,
@@ -574,8 +575,8 @@ var Gallery = gOS.registerApplication( function(){
        this.onOpen = function( w, h ){
                headerH = Util.getElementSize( document.getElementById( 'gallery-header' ) ).height;
                
-               self.addEventListener( document.getElementById( 'gallery-close-button' ), 'click', Gallery.shutdown );
-               
+               nodeClose = eventRoot.createNode( document.getElementById( 'gallery-close-button' ), false, false, 'close-button-hover', 'pointer' );
+               nodeClose.addEventListener( 'click', Gallery.shutdown );
                nodePath = eventRoot.createNode( document.getElementById( 'gallery-path' ), false, false );
                nodeBody = eventRoot.createNode( document.getElementById( 'gallery-container' ), false, true, null, '', true );
                
index 265a0f3..30acc7a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.5.21
+ *   version 0.5.22
  *
  * gadgetOS
  *   author:
@@ -1067,12 +1067,10 @@ ApplicationPrivateData.prototype = {
        cursor        : '',
        w             : 0,
        h             : 0,
-       init          : function( displayName, appClass, isOverlay ){
-               // this.application = app;
-               this.displayName = displayName;
+       init          : function( appClass, displayName, isOverlay ){
                this.appClass    = appClass;
+               this.displayName = displayName;
                this.isOverlay   = isOverlay;
-               // app.rootElement  = ;
                this.rootElement = document.createElement( 'div' );
                this.styleCursor = this.rootElement.style;
                ApplicationPrivateData.list.push( this );
@@ -1114,7 +1112,10 @@ ApplicationPrivateData.get = function( app ){
        return null;
 };
 
-var AbstractApplication = {
+var AbstractApplication = function( appClass, displayName, isOverlay ){
+       ( new ApplicationPrivateData() ).init( appClass, displayName, isOverlay );
+};
+AbstractApplication.prototype = {
        getUID : function(){
                var data = ApplicationPrivateData.get( this );
                return Util.getIndex( API_USER_LIST, data.appClass );
@@ -1126,7 +1127,6 @@ var AbstractApplication = {
                data.phase = 1;
                data.appClass === Page.appClass && Page.show();
                this.onInit();
-               // data.layer && data.layer.start();
                data.phase = 2;
        },
        open : function( w, h /*, _option */ ){
@@ -1151,7 +1151,6 @@ var AbstractApplication = {
                        return;
                };
                this.onPaneResize( w, h );
-               // data.layer !== null && data.layer.onResize( w, h );
        },
        close : function(){
                var data = ApplicationPrivateData.get( this );
@@ -1172,8 +1171,6 @@ var AbstractApplication = {
                SystemTimer.remove( this );
                AsyncCall.remove( this );
                StyleSheet.unload( this );
-               
-               // data.layer && data.layer.destroy();
 
                var elm = this.rootElement;
                Util.removeAllChildren( elm );
@@ -2141,7 +2138,7 @@ var Application = ( function(){
                        return Util.getIndex( API_USER_LIST, appClass );
                };
                this.boot = function( /* _option */ ){
-                       application = Application.boot( displayName, self.getUID(), appClass, isOverlay, Util.copyArray( arguments ) );
+                       application = Application.boot( appClass, displayName, self.getUID(), isOverlay, Util.copyArray( arguments ) );
                };
                this.shutdown = function(){
                        if( !application ) return false;
@@ -2175,16 +2172,16 @@ var Application = ( function(){
                isCurrentAppplication: function( app ){
                        return app === currentApplication;
                },
-               boot: function( displayName, uid, appClass, isOverlay, arg ){
+               boot: function( appClass, displayName, uid, isOverlay, arg ){
                        if( currentApplication ){
                                if( currentApplication.getUID() === uid ) return null;
                                if( isOverlay === false && currentApplication.close() === false ) return null;
                        };
 
-                       appClass.prototype = AbstractApplication;
-                       var data = new ApplicationPrivateData();
-                       data.init( displayName, appClass, isOverlay );
-                       var application = new appClass(); // new は boot で
+                       appClass.prototype = new AbstractApplication( appClass, displayName, isOverlay );
+                       
+                       var application = new appClass(),
+                               data = ApplicationPrivateData.get( application );
                        
                        coveredApplication = isOverlay === true ? currentApplication : null;
                        
@@ -2200,7 +2197,7 @@ var Application = ( function(){
                                application.addAsyncCall( asyncOpen, arg );
                        } else {
                                Overlay.show( application, arg );
-                       }
+                       };
                        
                        return application;
                },
@@ -3752,9 +3749,6 @@ var Overlay = ( function(){
                        }).fadeOut( onFadeOutComplete );
                        visible = false;
                        
-                       KeyEvent.remove( application, Const.KEY.EVENT.KEY_DOWN, Overlay.hide ); // 27.esc
-                       MouseEvent.remove( application, elmCloseButton );
-                       
                        application = null;
                },
                onWindowResize: function( _windowW, _windowH ){