[Commits] r1116 - in core/trunk/geoext: lib/GeoExt/widgets tests/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Fri Jun 19 17:15:04 CEST 2009
Author: tschaub
Date: 2009-06-19 17:15:04 +0200 (Fri, 19 Jun 2009)
New Revision: 1116
Modified:
core/trunk/geoext/lib/GeoExt/widgets/Action.js
core/trunk/geoext/tests/lib/GeoExt/widgets/Action.html
Log:
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)
Modified: core/trunk/geoext/lib/GeoExt/widgets/Action.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/Action.js 2009-06-19 14:35:06 UTC (rev 1115)
+++ core/trunk/geoext/lib/GeoExt/widgets/Action.js 2009-06-19 15:15:04 UTC (rev 1116)
@@ -47,6 +47,7 @@
* to. For controls that don't need to be added to a map or have already
* been added to one, this config property may be omitted.
*/
+ map: null,
/** private: property[uScope]
* ``Object`` The user-provided scope, used when calling uHandler,
@@ -97,6 +98,7 @@
// If map is provided in config, add control to map.
if(config.map) {
config.map.addControl(ctrl);
+ delete config.map;
}
ctrl.events.on({
activate: this.onCtrlActivate,
Modified: core/trunk/geoext/tests/lib/GeoExt/widgets/Action.html
===================================================================
--- core/trunk/geoext/tests/lib/GeoExt/widgets/Action.html 2009-06-19 14:35:06 UTC (rev 1115)
+++ core/trunk/geoext/tests/lib/GeoExt/widgets/Action.html 2009-06-19 15:15:04 UTC (rev 1116)
@@ -8,7 +8,7 @@
<script type="text/javascript">
function test_constructor(t) {
- t.plan(11)
+ t.plan(12)
var ctrl, scope, handler, toggleHandler, checkHandler, cfg, action;
@@ -34,6 +34,8 @@
"constructor sets control in the instance");
t.ok(action.control.map === map,
"constructor adds control to map if provided");
+ t.ok(!action.initialConfig.map,
+ "action does not have a reference to the map");
t.ok(action.uScope == scope,
"constructor sets this.uScope to user-provided scope");
t.ok(action.uHandler == handler,
More information about the Commits
mailing list