diff --git a/core/modules/new_widgets/list.js b/core/modules/new_widgets/list.js index 93b8005e3..58d9ae6fc 100755 --- a/core/modules/new_widgets/list.js +++ b/core/modules/new_widgets/list.js @@ -142,7 +142,7 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) { return this.refreshChildren(changedTiddlers); } else { // Replace the previous content with the empty message - var nextSibling = this.findNextSibling(); + var nextSibling = this.findNextSiblingDomNode(); this.removeChildDomNodes(); this.makeChildWidgets(this.getEmptyMessage()); this.renderChildren(this.parentDomNode,nextSibling); @@ -200,9 +200,9 @@ Insert a new list item at the specified index */ ListWidget.prototype.insertListItem = function(index,title) { var newItem = this.makeChildWidget(this.makeItemTemplate(title)); - newItem.parentDomNode = this.parentDomNode; // Hack to enable findNextSibling() to work + newItem.parentDomNode = this.parentDomNode; // Hack to enable findNextSiblingDomNode() to work this.children.splice(index,0,newItem); - var nextSibling = newItem.findNextSibling(); + var nextSibling = newItem.findNextSiblingDomNode(); newItem.render(this.parentDomNode,nextSibling); return true; }; diff --git a/core/modules/new_widgets/widget.js b/core/modules/new_widgets/widget.js index 93ed058ca..eb8b90cf9 100755 --- a/core/modules/new_widgets/widget.js +++ b/core/modules/new_widgets/widget.js @@ -356,7 +356,7 @@ Widget.prototype.refresh = function(changedTiddlers) { Rebuild a previously rendered widget */ Widget.prototype.refreshSelf = function() { - var nextSibling = this.findNextSibling(); + var nextSibling = this.findNextSiblingDomNode(); this.removeChildDomNodes(); this.render(this.parentDomNode,nextSibling); }; @@ -376,7 +376,7 @@ Widget.prototype.refreshChildren = function(changedTiddlers) { /* Find the next sibling in the DOM to this widget. This is done by scanning the widget tree through all next siblings and their descendents that share the same parent DOM node */ -Widget.prototype.findNextSibling = function(startIndex) { +Widget.prototype.findNextSiblingDomNode = function(startIndex) { // Refer to this widget by its index within its parents children var parent = this.parentWidget, index = startIndex !== undefined ? startIndex : parent.children.indexOf(this); @@ -394,7 +394,7 @@ if(index === -1) { var grandParent = parent.parentWidget; if(grandParent && parent.parentDomNode === this.parentDomNode) { index = grandParent.children.indexOf(parent); - return parent.findNextSibling(index); + return parent.findNextSiblingDomNode(index); } return null; };