mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-22 23:16:53 +00:00
Refactor name of "findNextSiblingDomNode()" method for consistency
This commit is contained in:
parent
40c6b6cb8f
commit
6f2dbd0978
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user