[OpenLayers-Trac] Re: [OpenLayers] #2880: handleBrowserEvent: don't compute mouseposition if it's not needed

OpenLayers trac-20090302 at openlayers.org
Thu Oct 14 02:54:01 EDT 2010


#2880: handleBrowserEvent: don't compute mouseposition if it's not needed
---------------------+------------------------------------------------------
 Reporter:  fredj    |       Owner:  tschaub     
     Type:  feature  |      Status:  new         
 Priority:  minor    |   Milestone:  2.11 Release
Component:  Events   |     Version:              
 Keywords:           |       State:              
---------------------+------------------------------------------------------

Comment(by erilem):

 {{{addEventType}}} initializes the type's listeners array to {{{[]}}}, so
 I think we should do

 {{{
 var listeners = this.listeners[evt.type];
 if(listeners && listeners.length > 0) {
     if (this.includeXY) {
         evt.xy = this.getMousePosition(evt);
     }
     this.triggerEvent(evt.type, evt);
 }
 }}}

 just like what {{{triggerEvent}}} itself does.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2880#comment:1>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list