case 'beforeunload' :
// ie では a href='javascript' な要素でも beforeunload が起こる
href = e.target && e.target[ 'attr' ] && e.target[ 'attr' ]( 'href' );
- if( href && href.indexOf && href.indexOf( 'javascript:' ) === 0 ) return X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_STOP_PROPAGATION;
+ if( X_Type_isString( href ) && !href.toLowerCase().indexOf( 'javascript:' ) ) return X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_STOP_PROPAGATION;
return X_ViewPort[ 'dispatch' ]( X_EVENT_BEFORE_UNLOAD );
X_ViewPort[ 'dispatch' ]( X_EVENT_UNLOAD );
//alert('unload');
X_ViewPort_document[ 'kill' ]();
- this[ 'kill' ]();
+ X_ViewPort[ 'kill' ]();
//X_System[ 'dispatch' ]( X_EVENT_SHUT_DOWN );
break;
};
+// TODO EventDispatcherProxy
/**
* window に相当する ViewPort 情報を提供するオブジェクト。
* @namespace X.ViewPort
};
X_TEMP.onDomContentLoaded = function(){
- var s, size, html, head, body;
+ var html, head, body;
console.log( '> X_TEMP.onDomContentLoaded rs:' + X_ViewPort_readyState );
X_ViewPort_rootElement = document.compatMode !== 'CSS1Compat' ? X_elmBody : X_elmHtml || X_elmBody;
/**
- * Node( documentElement )
+ * X.Node( documentElement )
* @alias X.Doc.html
* @type {Node}
*/
html[ '_flags' ] |= X_NodeFlags_IN_TREE;
/**
- * Node( head )
+ * X.Node( head )
* @alias X.Doc.head
* @type {Node}
*/
X[ 'Doc' ][ 'head' ] = head = X_Node_head = X_elmHead && Node( X_elmHead );
/**
- * Node( documentElement )
+ * X.Node( body )
* @alias X.Doc.body
* @type {Node}
*/
console.log( '------------------->' );
if( document[ 'webkitHidden' ] !== undefined ){
- console.log( '--> has webkitvisibilitychange' );
X_EventDispatcher_systemListen( X_ViewPort_document, 'webkitvisibilitychange', X_ViewPort );
} else
if( document[ 'hidden' ] !== undefined ){// iOS 7+
- console.log( '--> has visibilitychange' );
X_EventDispatcher_systemListen( X_ViewPort_document, 'visibilitychange', X_ViewPort );
- document.onvisibilitychange = function(){ console.log( '!!!!!!!!!!!!!!!!' ) };
} else
if( document[ 'msHidden' ] !== undefined ){
X_EventDispatcher_systemListen( X_ViewPort_document, 'msvisibilitychange', X_ViewPort );
};
if( window[ 'onpageshow' ] !== undefined ){
- console.log( '-------------------> pageshow, pagehide' );
X_EventDispatcher_systemListen( X_ViewPort, [ 'pageshow', 'pagehide' ] );
};
if( document[ 'onfocusin' ] !== undefined ){
- console.log( '-------------------> focusin, focusout' );
// https://github.com/ai/visibilityjs/blob/master/lib/visibility.fallback.js
X_EventDispatcher_systemListen( X_ViewPort_document, [ 'focusin', 'focusout' ], X_ViewPort );
};