views.mainTabs.addTab(title, slug, view);\r
}\r
\r
+ var commands = {\r
+ highlightDocumentNode: function(wlxmlNode, origin) {\r
+ ['documentCanvas', 'nodeBreadCrumbs', 'nodeFamilyTree'].forEach(function(moduleName) {\r
+ if(!origin || moduleName != origin)\r
+ sandbox.getModule(moduleName).highlightNode(wlxmlNode)\r
+ });\r
+ },\r
+ dimDocumentNode: function(wlxmlNode, origin) {\r
+ ['documentCanvas', 'nodeBreadCrumbs', 'nodeFamilyTree'].forEach(function(moduleName) {\r
+ if(!origin || moduleName != origin)\r
+ sandbox.getModule(moduleName).dimNode(wlxmlNode)\r
+ });\r
+ }\r
+ }\r
+ \r
+\r
var views = {\r
mainLayout: new layout.Layout(mainLayoutTemplate),\r
mainTabs: (new tabs.View()).render(),\r
sandbox.getDOM().append(views.mainLayout.getAsView());\r
\r
views.visualEditingSidebar.addTab({icon: 'pencil'}, 'edit', views.currentNodePaneLayout.getAsView());\r
- \r
- \r
\r
\r
/* Events handling */\r
\r
},\r
\r
- nodeHovered: function(node) {\r
- sandbox.getModule('documentCanvas').highlightNode(node.attr('id'));\r
- sandbox.getModule('nodeFamilyTree').highlightNode(node.attr('id'));\r
- sandbox.getModule('nodeBreadCrumbs').highlightNode(node.attr('id'));\r
- \r
+ nodeHovered: function(wlxmlNode) {\r
+ commands.highlightDocumentNode(wlxmlNode);\r
},\r
\r
- nodeBlured: function(node) {\r
- sandbox.getModule('documentCanvas').dimNode(node.attr('id'));\r
- sandbox.getModule('nodeFamilyTree').dimNode(node.attr('id'));\r
- sandbox.getModule('nodeBreadCrumbs').dimNode(node.attr('id'));\r
+ nodeBlured: function(wlxmlNode) {\r
+ commands.dimDocumentNode(wlxmlNode);\r
}\r
};\r
\r
ready: function() {\r
views.currentNodePaneLayout.appendView(sandbox.getModule('nodeFamilyTree').getView());\r
},\r
- nodeEntered: function(id) {\r
- sandbox.getModule('documentCanvas').highlightNode(id);\r
+ nodeEntered: function(wlxmlNode) {\r
+ commands.highlightDocumentNode(wlxmlNode, 'nodeFamilyTree');\r
},\r
- nodeLeft: function(id) {\r
- sandbox.getModule('documentCanvas').dimNode(id);\r
+ nodeLeft: function(wlxmlNode) {\r
+ commands.dimDocumentNode(wlxmlNode, 'nodeFamilyTree');\r
},\r
- nodeSelected: function(id) {\r
- sandbox.getModule('documentCanvas').selectNode(id);\r
+ nodeSelected: function(wlxmlNode) {\r
+ sandbox.getModule('documentCanvas').selectNode(wlxmlNode);\r
}\r
};\r
\r
ready: function() {\r
views.visualEditing.setView('statusBar', sandbox.getModule('nodeBreadCrumbs').getView());\r
},\r
- nodeHighlighted: function(id) {\r
- sandbox.getModule('documentCanvas').highlightNode(id);\r
+ nodeHighlighted: function(wlxmlNode) {\r
+ commands.highlightDocumentNode(wlxmlNode, 'nodeBreadCrumbs');\r
},\r
- nodeDimmed: function(id) {\r
- sandbox.getModule('documentCanvas').dimNode(id);\r
+ nodeDimmed: function(wlxmlNode) {\r
+ commands.dimDocumentNode(wlxmlNode, 'nodeBreadCrumbs');\r
},\r
- nodeSelected: function(id) {\r
- sandbox.getModule('documentCanvas').selectNode(id);\r
+ nodeSelected: function(wlxmlNode) {\r
+ sandbox.getModule('documentCanvas').selectNode(wlxmlNode);\r
} \r
}\r
\r