From a62e78292f9a2e4dbb6bda625c7cbf6dd0759f1e Mon Sep 17 00:00:00 2001 From: Inez Korczynski Date: Wed, 20 Jun 2012 16:43:35 -0700 Subject: [PATCH] Add slugs inside empty branch nodes so cursor can be correctly placed. Change-Id: I075a76da50bd4927c3832a660fdf96bbd250e3b0 --- modules/ve/ce/ve.ce.BranchNode.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ve/ce/ve.ce.BranchNode.js b/modules/ve/ce/ve.ce.BranchNode.js index 5d07adf386..1c13b7b3c9 100644 --- a/modules/ve/ce/ve.ce.BranchNode.js +++ b/modules/ve/ce/ve.ce.BranchNode.js @@ -168,6 +168,12 @@ ve.ce.BranchNode.prototype.onSplice = function( index, howmany ) { } // Iterate over all children of this branch and add slugs in appropriate places + if ( this.getLength() === 0 ) { + this.$.empty(); + this.$slugs = this.$slugs.add( + $slug.clone().appendTo( this.$ ) + ); + } for ( i = 0; i < this.children.length; i++ ) { if ( this.children[i].canHaveSlug() ) { if ( i === 0 ) {