From: Aleksander Ɓukasz Date: Sun, 4 Aug 2013 20:51:08 +0000 (+0200) Subject: internal container wip: fixing setup of some canvas dom events X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e7de024e8c0798383a31b7c8bb08dc31a5ce876a internal container wip: fixing setup of some canvas dom events --- diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index f96e62e..83fc504 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -206,9 +206,9 @@ $.extend(Canvas.prototype, { } }); - this.wrapper.on('click', '[wlxml-tag], [document-text-element]', function(e) { + this.wrapper.on('click', '[document-node-element], [document-text-element]', function(e) { e.stopPropagation(); - canvas.setCurrentElement(canvas.getDocumentElement(e.target), {caretTo: false}); + canvas.setCurrentElement(canvas.getDocumentElement(e.currentTarget), {caretTo: false}); }); var observer = new MutationObserver(function(mutations) { @@ -221,8 +221,8 @@ $.extend(Canvas.prototype, { observer.observe(this.d[0], config); - this.wrapper.on('mouseover', '[wlxml-tag], [document-text-element]', function(e) { - var el = canvas.getDocumentElement(e.target); + this.wrapper.on('mouseover', '[document-node-element], [document-text-element]', function(e) { + var el = canvas.getDocumentElement(e.currentTarget); if(!el) return; e.stopPropagation(); @@ -230,8 +230,8 @@ $.extend(Canvas.prototype, { el = el.parent(); el.toggleLabel(true); }); - this.wrapper.on('mouseout', '[wlxml-tag], [document-text-element]', function(e) { - var el = canvas.getDocumentElement(e.target); + this.wrapper.on('mouseout', '[document-node-element], [document-text-element]', function(e) { + var el = canvas.getDocumentElement(e.currentTarget); if(!el) return; e.stopPropagation();