handleBrowserEvent: don't compute mouse position if it's not needed. r=erilem (closes #2880)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10873 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user