Skip to content

Commit

Permalink
handleBrowserEvent: don't compute mouse position if it's not needed. …
Browse files Browse the repository at this point in the history
…r=erilem (closes #2880)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10873 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
  • Loading branch information
fredj committed Nov 5, 2010
1 parent 5924c75 commit 34c52fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/OpenLayers/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,15 @@ OpenLayers.Events = OpenLayers.Class({
* evt - {Event}
*/
handleBrowserEvent: function (evt) {
var type = evt.type, listeners = this.listeners[type];
if(!listeners || listeners.length == 0) {
// none's listening, bail out
return;
}
if (this.includeXY) {
evt.xy = this.getMousePosition(evt);
}
this.triggerEvent(evt.type, evt);
this.triggerEvent(type, evt);
},

/**
Expand Down

0 comments on commit 34c52fb

Please sign in to comment.