Skip to content

Commit

Permalink
Check highlight option in mouseover() instead of highlight().
Browse files Browse the repository at this point in the history
This allow external methods to control the highlight status, just as it is possible to set isSelectable to false, and control the selection status from external methods.
Effectively, mouseover() and mouseout() no long call the highlight() and clearEffects() methods if the highlight option is false. Also, the highlight() method now highlights the area, regardless of the highlight option.
See jamietre#190.
  • Loading branch information
macfreek committed Mar 2, 2014
1 parent 97ad04c commit eb777c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/areadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@

highlight: function (options) {
var o = this.owner;
if (this.effectiveOptions().highlight) {
o.graphics.addShapeGroup(this, "highlight",options);
}
o.graphics.addShapeGroup(this, "highlight",options);
o.setHighlightId(this.areaId);
this.changeState('highlight', true);
},
Expand Down
9 changes: 9 additions & 0 deletions src/mapdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@
if (me.currentAreaId === ar.areaId) {
return;
}

if (!ar.effectiveOptions().highlight) {
return;
}

if (me.highlightId !== ar.areaId) {
me.clearEffects();

Expand Down Expand Up @@ -201,6 +206,10 @@
return;
}

if (!ar.effectiveOptions().highlight) {
return;
}

newArea=me.getDataForArea(e.relatedTarget);

if (newArea === ar) {
Expand Down

0 comments on commit eb777c4

Please sign in to comment.