OpenLayers OpenLayers

Ticket #895: Panel.js.diff

File Panel.js.diff, 1.2 kB (added by jachym, 1 year ago)

Patch to lib/OpenLayers/Control/Panel.js

  • lib/OpenLayers/Control/Panel.js

    old new  
    120120     */ 
    121121    activateControl: function (control) { 
    122122        if (!this.active) { return false; } 
    123         if (control.type == OpenLayers.Control.TYPE_BUTTON) { 
    124             control.trigger(); 
    125             return; 
    126         } 
    127123        if (control.type == OpenLayers.Control.TYPE_TOGGLE) { 
    128124            if (control.active) { 
    129125                control.deactivate(); 
    130126            } else { 
    131127                control.activate(); 
    132128            } 
     129            this.redraw(); 
    133130            return; 
    134131        } 
    135132        for (var i = 0; i < this.controls.length; i++) { 
    136133            if (this.controls[i] == control) { 
    137                 control.activate(); 
     134                if (control.active) { 
     135                    control.deactivate(); 
     136                } 
     137                else { 
     138                    control.activate(); 
     139                } 
    138140            } else { 
    139141                if (this.controls[i].type != OpenLayers.Control.TYPE_TOGGLE) { 
    140142                    this.controls[i].deactivate();