OpenLayers OpenLayers

Changeset 1329

Show
Ignore:
Timestamp:
08/22/06 09:09:53 (2 years ago)
Author:
crschmidt
Message:

If a mouseup is not preceeded by a mousedown *inside the layerswitcher*,
then the mouseup should be allowed to drop through to the map, since it
may have started as part of a drag action.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/openlayers/2.0/lib/OpenLayers/Control/LayerSwitcher.js

    r1314 r1329  
    119119            inputElem.type = (baseLayer) ? "radio" : "checkbox"; 
    120120            inputElem.value = layer.name; 
     121            inputElem.checked = checked; 
    121122            inputElem.checked = checked; 
    122123            inputElem.layer = layer; 
     
    162163 
    163164    onInputClick: function(e) { 
    164         var clickedRadioButton = ((this.type == "radio") && (this.checked)); 
    165         if (!clickedRadioButton) { 
     165        if (this.type == "radio") { 
     166            this.checked = true; 
     167        } else { 
    166168            this.checked = !this.checked; 
    167169        } 
     
    275277     
    276278        Event.observe(this.div, "mouseup",  
    277                       this.ignoreEvent); 
     279                      this.mouseUp.bindAsEventListener(this)); 
    278280        Event.observe(this.div, "click", 
    279281                      this.ignoreEvent); 
    280282        Event.observe(this.div, "mousedown", 
    281                       this.ignoreEvent); 
     283                      this.mouseDown.bindAsEventListener(this)); 
    282284        Event.observe(this.div, "dblclick", this.ignoreEvent); 
    283285