- setDocument: function(xml) {
- view.setMetadata(transformations.getMetadata(xml));
- sandbox.publish('metadataSet');
+ setDocument: function(document) {
+ document.on('change', function(event) {
+ if(event.type === 'nodeMetadataChange' && event.meta.node.sameNode(currentNode)) {
+ view.setMetadata(currentNode);
+ }
+ });
+// view.setMetadata(transformations.getMetadata(xml));
+ // sandbox.publish('metadataSet'); to wywalki
+ },
+ setNodeElement: function(node) {
+ if(currentNode && currentNode.sameNode(node)) {
+ return;
+ }
+ currentNode = node;
+ view.setMetadata(node);