From ab6fa141d7c0d032ef01c04f657e84349e27968a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 17 Dec 2013 11:50:48 +0100 Subject: [PATCH 1/1] editor: fix - removing redundant event handlers Handlers on canvas wrapper should be set only once, not with every document load. --- src/editor/modules/documentCanvas/canvas/canvas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index 6a60f80..e83029a 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -52,6 +52,7 @@ var Canvas = function(wlxmlDocument, publisher) { this.wrapper = $('
').addClass('canvas-wrapper').attr('contenteditable', true); this.wlxmlListener = wlxmlListener.create(this); this.loadWlxmlDocument(wlxmlDocument); + this.setupEventHandling(); this.publisher = publisher ? publisher : function() {}; this.textHandler = new TextHandler(this); }; @@ -66,7 +67,6 @@ $.extend(Canvas.prototype, { this.wlxmlListener.listenTo(wlxmlDocument); this.wlxmlDocument = wlxmlDocument; this.reloadRoot(); - this.setupEventHandling(); }, reloadRoot: function() { -- 2.20.1