X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2Fui%2F20_PageRoot.js;h=11fe1dfe29267feb363dd6fc710a7e71a84bd5cd;hb=4e5a06c9c610f8d3777f9d2eef71ec1365ffff1b;hp=d9167ad7b638d862eef7d930f51cc4cbc34a2ff4;hpb=46d3fdf2559c59963e53ff6136c3fd58cd8f7a6d;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/ui/20_PageRoot.js b/0.6.x/js/ui/20_PageRoot.js index d9167ad..11fe1df 100644 --- a/0.6.x/js/ui/20_PageRoot.js +++ b/0.6.x/js/ui/20_PageRoot.js @@ -1,5 +1,5 @@ -function eventRellay( e ){ +X.UI._eventRellay = function( e ){ var x = e.clientX / X.Dom.baseFontSize, y = e.clientY / X.Dom.baseFontSize, type = X.UI.Event.NameToID[ e.type ], @@ -8,15 +8,21 @@ function eventRellay( e ){ sysOnly = false, ret = X.Callback.NONE, list, parent, _ret; - //if( type !== '' + X.UI.Event._POINTER_MOVE && type !== '' + X.UI.Event._TOUCH_MOVE && type !== '' + X.UI.Event._MOUSE_MOVE ){ - //console.log( e.type + ' ' + type + ' x:' + x + ', y:' + y ); - //}; + + // mouseup で alert を出すと mouseleave が発生、ということでイベント中のイベント発火を禁止 + if( !data || data._eventBusy ) return ret; + data._eventBusy = true; + + if( type !== '' + X.UI.Event._POINTER_MOVE && type !== '' + X.UI.Event._TOUCH_MOVE && type !== '' + X.UI.Event._MOUSE_MOVE ){ + // console.log( e.type + ' ' + type + ' x:' + x + ', y:' + y ); + }; e.type = type; - if( data && ( data = data.monopolyNodeData ) && ( ret = data.dispatch( e ) ) & X.Callback.MONOPOLY ) return ret; - - if( X.UI.currentRootData === null ) return ret; + if( data && ( data = data.monopolyNodeData ) && ( ret = data.dispatch( e ) ) & X.Callback.MONOPOLY ){ + delete X.UI.currentRootData._eventBusy; + return ret; + }; list = X.UI.currentRootData.hoverList; ( X.UI.currentRootData.targetNodeData = X.UI.currentRootData ).capcher( x, y ); @@ -49,6 +55,7 @@ function eventRellay( e ){ data.hovering = true; }; }; + delete X.UI.currentRootData._eventBusy; return ret; }; @@ -57,7 +64,7 @@ function eventRellay( e ){ * 背景画像を読み終える onload で活動開始 */ -var _PageRoot = _Box.inherits( +X.UI._PageRoot = X.UI._Box.inherits( '_PageRoot', X.Class.FINAL | X.Class.PRIVATE_DATA | X.Class.SUPER_ACCESS, { @@ -72,6 +79,8 @@ var _PageRoot = _Box.inherits( eventCounter : null, cursorStyle : null, + _eventBusy : false, + Constructor : function( layout, args ){ this.SuperConstructor( layout, args ); @@ -96,9 +105,9 @@ var _PageRoot = _Box.inherits( // this.xnodeInteractiveLayer の前に追加する! - this.addToParent( X.Dom.Node.root ); + this.addToParent( X.Dom.Node._body ); - this.xnodeInteractiveLayer = X.Dom.Node.root.create( 'div', { + this.xnodeInteractiveLayer = X.Dom.Node._body.create( 'div', { 'class' : 'mouse-operation-catcher', unselectable : 'on' } ); @@ -106,15 +115,15 @@ var _PageRoot = _Box.inherits( // hover や rollover rollout のための move イベントの追加 // X.Dom.Event.activate, X.Dom.Event.deactivate ? // mouseout, mouseover - if( navigator.msPointerEnabled || navigator.pointerEnabled ){ - this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._POINTER_MOVE ], eventRellay ); + if( X.Dom.EVENT_POINTER ){ + this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._POINTER_MOVE ], X.UI._eventRellay ); if( counter[ X.UI.Event._POINTER_MOVE ] ){ ++counter[ X.UI.Event._POINTER_MOVE ]; } else { counter[ X.UI.Event._POINTER_MOVE ] = 1; }; } else { - this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._MOUSE_MOVE ], eventRellay ); + this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._MOUSE_MOVE ], X.UI._eventRellay ); if( counter[ X.UI.Event._MOUSE_MOVE ] ){ ++counter[ X.UI.Event._MOUSE_MOVE ]; } else { @@ -170,9 +179,10 @@ var _PageRoot = _Box.inherits( } ); -var PageRoot = Box.presets( +X.UI.PageRoot = X.UI.Box.presets( 'PageRoot', - _PageRoot, { + X.UI._PageRoot, + { width : '100%', height : '100%' }