OpenLayers OpenLayers

Changeset 7325

Show
Ignore:
Timestamp:
06/06/08 15:07:35 (6 months ago)
Author:
sbenthall
Message:

can set non-value specific click behavior for radio

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/topp/almanac/lib/OpenLayers/Control/Radio.js

    r7315 r7325  
    101101     
    102102    setOnclickBehavior: function(value, scope, behavior){ 
     103        if(value){ 
     104            var func = behavior 
     105 
     106            behavior = function(evt){ 
     107                if(evt.value == value){ 
     108                    func(evt); 
     109                } 
     110            } 
     111        } 
     112 
     113 
    103114        this.events.on({ 
    104             "clicked" : function(evt){ 
    105                 if(evt.value == value){ 
    106                     behavior(evt); //maybe the argument here should just be the value? 
    107                 }                 
    108             }, 
     115            "clicked" : behavior, 
    109116            scope: scope 
    110117        });