- updateCurrentNodeElement: function(nodeElement) {
- sandbox.getModule('nodePane').setNodeElement(nodeElement);
- sandbox.getModule('nodeFamilyTree').setElement(nodeElement);
- sandbox.getModule('nodeBreadCrumbs').setNodeElement(nodeElement);
- sandbox.getModule('documentToolbar').setNodeElement(nodeElement);
- sandbox.getModule('metadataEditor').setNodeElement(nodeElement);
+ refreshCanvasSelection: function(selection) {
+ var fragment = selection.toDocumentFragment(),
+ elementParent;
+
+ sandbox.getModule('documentToolbar').setDocumentFragment(fragment);
+
+ if(fragment && fragment.node) {
+ elementParent = fragment.node.getNearestElementNode();
+ sandbox.getModule('nodePane').setNodeElement(elementParent);
+ sandbox.getModule('nodeFamilyTree').setElement(fragment.node);
+ sandbox.getModule('nodeBreadCrumbs').setNodeElement(elementParent);
+ sandbox.getModule('metadataEditor').setNodeElement(elementParent);
+ } else {
+ sandbox.getModule('nodePane').setNodeElement(null);
+ sandbox.getModule('nodeFamilyTree').setElement(null);
+ sandbox.getModule('nodeBreadCrumbs').setNodeElement(null);
+ sandbox.getModule('metadataEditor').setNodeElement(null);
+ }