Changeset 1116

Show
Ignore:
Timestamp:
06/19/09 17:15:04 (1 year ago)
Author:
tschaub
Message:

Removing the action's reference to the map. At some point, we may revisit this. It could be useful to have the map reference on the initalConfig. Since the initialConfig of a GeoExt.Action cannot currently be used to create another action, the properties there are not of any use. r=ahocevar (closes #99)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • core/trunk/geoext/lib/GeoExt/widgets/Action.js

    r1109 r1116  
    4848     *  been added to one, this config property may be omitted. 
    4949     */ 
     50    map: null, 
    5051 
    5152    /** private: property[uScope] 
     
    9899            if(config.map) { 
    99100                config.map.addControl(ctrl); 
     101                delete config.map; 
    100102            } 
    101103            ctrl.events.on({ 
  • core/trunk/geoext/tests/lib/GeoExt/widgets/Action.html

    r941 r1116  
    99    <script type="text/javascript"> 
    1010        function test_constructor(t) { 
    11             t.plan(11
     11            t.plan(12
    1212 
    1313            var ctrl, scope, handler, toggleHandler, checkHandler, cfg, action; 
     
    3535            t.ok(action.control.map === map, 
    3636                 "constructor adds control to map if provided"); 
     37            t.ok(!action.initialConfig.map, 
     38                 "action does not have a reference to the map"); 
    3739            t.ok(action.uScope == scope, 
    3840                 "constructor sets this.uScope to user-provided scope");