view.dimNode(wlxmlNode);\r
},\r
selectNode: function(wlxmlNode) {\r
- view.selectNode(wlxmlNode, {moveCarret: true});\r
+ if(!wlxmlNode.is(view.currentNode))\r
+ view.selectNode(wlxmlNode, {moveCarret: true});\r
},\r
toggleGrid: function(toggle) {\r
view.toggleGrid(toggle);\r
list.push(new Node($(this)));\r
});\r
return $(list);\r
+ },\r
+ is: function(wlxmlNode) {\r
+ return wlxmlNode && (wlxmlNode.id === this.id);\r
}\r
}\r
\r
setNode: function(node) {\r
this.dom.empty();\r
var nodes = this.nodes = {};\r
+ this.currentNode = node;\r
this.nodes[node.id] = node;\r
var parents = node.parents();\r
parents.each(function() {\r
return {\r
start: function() { sandbox.publish('ready'); },\r
getView: function() { return view.dom; },\r
- setNode: function(node) { view.setNode(node); },\r
+ setNode: function(wlxmlNode) {\r
+ if(!wlxmlNode.is(view.currentNode)) {\r
+ view.setNode(wlxmlNode);\r
+ }\r
+ },\r
highlightNode: function(id) { view.highlightNode(id); },\r
dimNode: function(id) { view.dimNode(id); }\r
}\r
setNode: function(node) {\r
console.log('familyTree sets node');\r
var nodes = this.nodes = {};\r
+ this.currentNode = node;\r
var parentNode = node.parent();\r
var parent = undefined;\r
\r
start: function() {\r
sandbox.publish('ready');\r
},\r
- setNode: function(node) {\r
- view.setNode(node);\r
+ setNode: function(wlxmlNode) {\r
+ if(!wlxmlNode.is(view.currentNode))\r
+ view.setNode(wlxmlNode);\r
},\r
getView: function() {\r
return view.dom;\r
if(!origin || moduleName != origin)\r
sandbox.getModule(moduleName).dimNode(wlxmlNode)\r
});\r
+ },\r
+ selectNode: function(wlxmlNode, origin) {\r
+ sandbox.getModule('documentCanvas').selectNode(wlxmlNode);\r
+ sandbox.getModule('nodePane').setNode(wlxmlNode);\r
+ sandbox.getModule('nodeFamilyTree').setNode(wlxmlNode);\r
+ sandbox.getModule('nodeBreadCrumbs').setNode(wlxmlNode);\r
+ \r
}\r
}\r
\r
views.visualEditing.setView('leftColumn', sandbox.getModule('documentCanvas').getView());\r
},\r
\r
- nodeSelected: function(node) {\r
- sandbox.getModule('nodePane').setNode(node);\r
- sandbox.getModule('nodeFamilyTree').setNode(node);\r
- sandbox.getModule('nodeBreadCrumbs').setNode(node);\r
+ nodeSelected: function(wlxmlNode) {\r
+ commands.selectNode(wlxmlNode);\r
},\r
\r
contentChanged: function() {\r
commands.dimDocumentNode(wlxmlNode, 'nodeFamilyTree');\r
},\r
nodeSelected: function(wlxmlNode) {\r
- sandbox.getModule('documentCanvas').selectNode(wlxmlNode);\r
+ commands.selectNode(wlxmlNode);\r
}\r
};\r
\r
commands.dimDocumentNode(wlxmlNode, 'nodeBreadCrumbs');\r
},\r
nodeSelected: function(wlxmlNode) {\r
- sandbox.getModule('documentCanvas').selectNode(wlxmlNode);\r
+ commands.selectNode(wlxmlNode);\r
} \r
}\r
\r