3 'modules/documentCanvas/canvas/utils',
4 ], function($, utils) {
8 var Listener = function(canvas) {
12 $.extend(Listener.prototype, {
13 listenTo: function(wlxmlDocument) {
14 if(wlxmlDocument === this.wlxmlDocument) {
18 wlxmlDocument.on('change', function(event) {
19 var handler = handlers[event.type];
21 handler.bind(this)(event);
28 nodeAttrChange: function(event) {
29 if(event.meta.attr === 'class') {
30 var canvasNode = utils.findCanvasElement(event.meta.node);
31 canvasNode.setWlxmlClass(event.meta.newVal);
34 nodeTagChange: function(event) {
35 var canvasNode = utils.findCanvasElement(event.meta.node);
36 canvasNode.setWlxmlTag(event.meta.newTagName);
41 create: function(canvas) {
42 return new Listener(canvas);