From 00c555ebe5ce4f0e9727761625c4c0e617020b33 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 20 Jun 2012 23:19:56 -0700 Subject: [PATCH] Removed attach and detach methods from ve.ce.Node Added some needed functionality in ve.Node to make up for this Change-Id: Ife902aceb4e8535411dc653ae61087aecf67a0c6 --- modules/ve/ce/ve.ce.Node.js | 29 ++--------------------------- modules/ve/ve.Node.js | 3 ++- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/modules/ve/ce/ve.ce.Node.js b/modules/ve/ce/ve.ce.Node.js index f2d9c4c78d..998d6b5011 100644 --- a/modules/ve/ce/ve.ce.Node.js +++ b/modules/ve/ce/ve.ce.Node.js @@ -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 ); diff --git a/modules/ve/ve.Node.js b/modules/ve/ve.Node.js index 4c3e885633..7c4ce2af3a 100644 --- a/modules/ve/ve.Node.js +++ b/modules/ve/ve.Node.js @@ -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 ); }; /**