Fixing event handling in documentCanvas module
[fnpeditor.git] / modules / documentCanvas / documentCanvas.js
index ea44955..f7d7fd0 100644 (file)
@@ -20,9 +20,16 @@ return function(sandbox) {
                 sandbox.publish('contentChanged');\r
             });\r
 \r
-            this.node.on('mouseover', '[wlxml-tag]', function(e) { sandbox.publish('nodeHovered', $(e.target)); });\r
-            this.node.on('mouseout', '[wlxml-tag]', function(e) { sandbox.publish('nodeBlured', $(e.target)); });\r
+            this.node.on('mouseover', '[wlxml-tag]', function(e) {\r
+                e.stopPropagation();\r
+                sandbox.publish('nodeHovered', $(e.target));\r
+            });\r
+            this.node.on('mouseout', '[wlxml-tag]', function(e) {\r
+                e.stopPropagation();\r
+                sandbox.publish('nodeBlured', $(e.target));\r
+            });\r
             this.node.on('click', '[wlxml-tag]', function(e) {\r
+                e.stopPropagation();\r
                 console.log('clicked node type: '+e.target.nodeType);\r
                 view._markSelected($(e.target));\r
             });\r