X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F20_ui%2F14_ChromeBox.js;h=06ea4a5f0b005961b22e6512a2d7972a6874a032;hb=HEAD;hp=ed1cd7eb5706ac5f54a4678bdb4dbbb1e96400a4;hpb=eedd028ba64be2ea0828cf686f1d0ec3bb4010d5;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/20_ui/14_ChromeBox.js b/0.6.x/js/20_ui/14_ChromeBox.js index ed1cd7e..06ea4a5 100644 --- a/0.6.x/js/20_ui/14_ChromeBox.js +++ b/0.6.x/js/20_ui/14_ChromeBox.js @@ -1,14 +1,14 @@ -X.UI._ChromeBox = X.UI._Box.inherits( +var XUI_ChromeBox = XUI_Box.inherits( '_ChromeBox', - X_Class.PRIVATE_DATA | X_Class.SUPER_ACCESS, + X_Class.NONE, { chromeNodes : null, containerNode : null, - Constructor : function( layout, args ){ + Constructor : function( user, layout, args ){ var uinodes, i, l, node, after, index = 0; - this[ 'Super' ]( layout, args ); + this[ 'Super' ]( user, layout, args ); uinodes = this.uinodes; l = i = uinodes.length; @@ -19,7 +19,7 @@ X.UI._ChromeBox = X.UI._Box.inherits( if( this.containerNode ){ //throw new Error( 'ContainerNode が複数設定されています!ContainerNode はクロームボックスにひとつ、生成時に設定できます ' + node ); }; - this.containerNode = node.User; + this.containerNode = node.User; this._containerNode = node; } else { if( !this.chromeNodes ) this.chromeNodes = []; @@ -46,57 +46,44 @@ X.UI._ChromeBox = X.UI._Box.inherits( X.UI.ChromeBox = X.UI.Box.inherits( 'ChromeBox', - X_Class.SUPER_ACCESS, - X.UI._ChromeBox, + X_Class.NONE, { Constructor : function(){ - X_Class_newPrivate( this, X.UI.Layout.Canvas, arguments ); + X_Pair_create( this, XUI_ChromeBox( this, XUI_Layout_Canvas, arguments ) ); }, - add : function( node /* , node, node ... */ ){ - X_Class_getPrivate( this ).containerNode.addAt( this.numNodes(), Array.prototype.slice.call( arguments ) ); + add : function( /* node, node, node ... */ ){ + X_Pair_get( this ).containerNode.addAt( this.numNodes(), X_Array_copy( arguments ) ); return this; }, - addAt : function( index, node /* , node, node ... */ ){ - X_Class_getPrivate( this ).containerNode.addAt( index, Array.prototype.slice.call( arguments, 1 ) ); + addAt : function( index /* , node, node, node ... */ ){ + var nodes; + if( index < 0 ) index = 0; + nodes = X_Array_copy( arguments ); + X_Pair_get( this ).containerNode.addAt( nodes.shift(), nodes ); return this; }, remove : function( node /* , node, node ... */ ){ - X_Class_getPrivate( this ).containerNode[ 'remove' ]( arguments ); + X_Pair_get( this ).containerNode.remove( arguments ); return this; }, removeAt : function( from, length ){ - X_Class_getPrivate( this ).containerNode.removeAt( from, length ); + X_Pair_get( this ).containerNode.removeAt( from, length ); return this; }, getNodesByClass : function( klass ){ - return X_Class_getPrivate( this ).containerNode.User.getNodesByClass( klass ); + return X_Pair_get( this ).containerNode.User.getNodesByClass( klass ); }, getFirstChild : function(){ - return X_Class_getPrivate( this ).containerNode.User.getFirstChild(); + return X_Pair_get( this ).containerNode.User.getFirstChild(); }, getLastChild : function(){ - return X_Class_getPrivate( this ).containerNode.User.getLastChild(); - }, - getNodeByUID : function( uid ){ - return X_Class_getPrivate( this ).containerNode.User.getNodeByUID(); + return X_Pair_get( this ).containerNode.User.getLastChild(); }, getNodeAt : function( index ){ - return X_Class_getPrivate( this ).containerNode.User.getNodeAt( index ); + return X_Pair_get( this ).containerNode.User.getNodeAt( index ); }, numNodes : function(){ - return X_Class_getPrivate( this ).containerNode.User.numNodes(); - }, - getContainerNode : function(){ - return X_Class_getPrivate( this ).containerNode.User; - }, - getChromeNodeAt : function( index ){ - if( index < 0 ) return null; - var nodes = X_Class_getPrivate( this ).chromeNodes; - return nodes ? nodes[ index ].User || null : null; - }, - numChromeNodes : function(){ - var nodes = X_Class_getPrivate( this ).chromeNodes; - return nodes ? nodes.length : 0; + return X_Pair_get( this ).containerNode.User.numNodes(); } } ); \ No newline at end of file