Removed attach and detach methods from ve.ce.Node

Added some needed functionality in ve.Node to make up for this

Change-Id: Ife902aceb4e8535411dc653ae61087aecf67a0c6
This commit is contained in:
Trevor Parscal 2012-06-20 23:19:56 -07:00 committed by Catrope
parent dc646ff32c
commit 00c555ebe5
2 changed files with 4 additions and 28 deletions

View file

@ -177,40 +177,15 @@ ve.ce.Node.getSplitableNode = function( node ) {
ve.log(node);
if ( node.canBeSplit() ) {
splitableNode = node;
return true;
return true;
} else {
return false;
return false;
}
} );
return splitableNode;
};
/**
* Attaches node as a child to another node.
*
* @method
* @param {ve.ce.Node} parent Node to attach to
* @emits attach (parent)
*/
ve.ce.Node.prototype.attach = function( parent ) {
this.parent = parent;
this.emit( 'attach', parent );
};
/**
* Detaches node from its parent.
*
* @method
* @emits detach (parent)
*/
ve.ce.Node.prototype.detach = function() {
var parent = this.parent;
this.parent = null;
this.emit( 'detach', parent );
};
/* Inheritance */
ve.extendClass( ve.ce.Node, ve.Node );

View file

@ -174,10 +174,11 @@ ve.Node.prototype.attach = function( parent ) {
* @emits detach
*/
ve.Node.prototype.detach = function() {
var parent = this.parent;
this.parent = null;
this.setRoot( this );
this.setDocument();
this.emit( 'detach' );
this.emit( 'detach', parent );
};
/**