- updateCurrentNodeElement: function(nodeElement) {
- sandbox.getModule('nodePane').setNodeElement(nodeElement);
- sandbox.getModule('nodeFamilyTree').setElement(nodeElement);
- sandbox.getModule('nodeBreadCrumbs').setNodeElement(nodeElement);
- },
- updateCurrentTextElement: function(textElement) {
- sandbox.getModule('nodeFamilyTree').setElement(textElement);
- },
- resetDocument: function(document, reason) {
- var modules = [];
- if(reason === 'source_edit') {
- modules = ['documentCanvas', 'metadataEditor'];
- }
- else if (reason === 'edit') {
- modules = ['sourceEditor'];
- }
- else if (reason === 'revert') {
- modules = ['documentCanvas', 'metadataEditor', 'sourceEditor'];
+ refreshCanvasSelection: function(selection) {
+ var fragment = selection.toDocumentFragment(),
+ elementParent;
+
+ sandbox.getModule('documentToolbar').setDocumentFragment(fragment);
+
+ if(fragment && fragment.node) {
+ elementParent = fragment.node.getNearestElementNode();
+ sandbox.getModule('nodeBreadCrumbs').setNodeElement(elementParent);
+ } else {
+ sandbox.getModule('nodeBreadCrumbs').setNodeElement(null);