OpenLayers OpenLayers

Changeset 6038

Show
Ignore:
Timestamp:
02/07/08 17:29:05 (1 year ago)
Author:
tschaub
Message:

Opting for named event properties instead of positional arguments.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/tschaub/events/lib/OpenLayers/Events.js

    r5614 r6038  
    594594     * type - {String}  
    595595     * evt - {Event} 
    596      * args - {Array} Optional array of arguments to call the listener with. 
    597596     * 
    598597     * Returns: 
     
    600599     *     chain of listeners will stop getting called. 
    601600     */ 
    602     triggerEvent: function (type, evt, args) { 
     601    triggerEvent: function (type, evt) { 
    603602 
    604603        // prep evt object with object & div references 
     
    608607        evt.object = this.object; 
    609608        evt.element = this.element; 
    610          
    611         if(!args) { 
    612             args = [evt]; 
    613         } else { 
    614             args.unshift(evt); 
    615         } 
    616  
     609     
    617610        // execute all callbacks registered for specified type 
    618611        // get a clone of the listeners array to 
     
    625618                var callback = listeners[i]; 
    626619                // bind the context to callback.obj 
    627                 continueChain = callback.func.apply(callback.obj, args); 
     620                continueChain = callback.func.apply(callback.obj, [evt]); 
    628621     
    629622                if ((continueChain != undefined) && (continueChain == false)) {