Skip to content

Commit d7d278c

Browse files
fix mouseover, mouseout event bubbling. closes #78
1 parent 217fff0 commit d7d278c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

extension/scripts/ContentSelector.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,23 @@ ContentSelector.prototype = {
164164
bindElementHighlight: function () {
165165

166166
$(this.$allElements).bind("mouseover.elementSelector", function(e) {
167+
// allow event bubbling for other event listeners but not for web scraper.
168+
if(e.target !== e.currentTarget) {
169+
return;
170+
}
171+
167172
var element = e.currentTarget;
168173
this.mouseOverElement = element;
169174
$(element).addClass("-sitemap-select-item-hover");
170-
return false;
171175
}.bind(this)).bind("mouseout.elementSelector", function(e) {
176+
// allow event bubbling for other event listeners but not for web scraper.
177+
if(e.target !== e.currentTarget) {
178+
return;
179+
}
180+
172181
var element = e.currentTarget;
173182
this.mouseOverElement = null;
174183
$(element).removeClass("-sitemap-select-item-hover");
175-
return false;
176184
}.bind(this));
177185
},
178186

0 commit comments

Comments
 (0)