X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/eebb24ef74a635e06c6bc8f074302996ca5936ec..64bdf1aaa07bd683a71241e18e6e26200a481bab:/modules/documentCanvas/documentCanvas.js diff --git a/modules/documentCanvas/documentCanvas.js b/modules/documentCanvas/documentCanvas.js index f9a8b7a..f7d7fd0 100644 --- a/modules/documentCanvas/documentCanvas.js +++ b/modules/documentCanvas/documentCanvas.js @@ -20,9 +20,16 @@ return function(sandbox) { sandbox.publish('contentChanged'); }); - this.node.on('mouseover', '[wlxml-tag]', function(e) { sandbox.publish('nodeHovered', $(e.target)); }); - this.node.on('mouseout', '[wlxml-tag]', function(e) { sandbox.publish('nodeBlured', $(e.target)); }); + this.node.on('mouseover', '[wlxml-tag]', function(e) { + e.stopPropagation(); + sandbox.publish('nodeHovered', $(e.target)); + }); + this.node.on('mouseout', '[wlxml-tag]', function(e) { + e.stopPropagation(); + sandbox.publish('nodeBlured', $(e.target)); + }); this.node.on('click', '[wlxml-tag]', function(e) { + e.stopPropagation(); console.log('clicked node type: '+e.target.nodeType); view._markSelected($(e.target)); }); @@ -182,18 +189,18 @@ return function(sandbox) { }, highlightNode: function(node) { if(!this.gridToggled) { - node.addClass('rng-hover'); + node.addClass('rng-common-hoveredNode'); var label = node.attr('wlxml-tag'); if(node.attr('wlxml-class')) label += ' / ' + node.attr('wlxml-class'); - var tag = $('
').addClass('rng-visualEditor-nodeHoverTag').text(label); + var tag = $('
').addClass('rng-module-documentCanvas-hoveredNodeTag').text(label); node.append(tag); } }, dimNode: function(node) { if(!this.gridToggled) { - node.removeClass('rng-hover'); - node.find('.rng-visualEditor-nodeHoverTag').remove(); + node.removeClass('rng-common-hoveredNode'); + node.find('.rng-module-documentCanvas-hoveredNodeTag').remove(); } }, highlightNodeById: function(id) { @@ -219,7 +226,7 @@ return function(sandbox) { this.selectNode(node); }, toggleGrid: function(toggle) { - this.node.find('[wlxml-tag]').toggleClass('rng-hover', toggle); + this.node.find('[wlxml-tag]').toggleClass('rng-common-hoveredNode', toggle); this.gridToggled = toggle; } };