[Commits] r422 - in sandbox/opengeo/geoexplorer: . lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Sat Apr 18 18:21:32 CEST 2009
Author: tschaub
Date: 2009-04-18 18:21:32 +0200 (Sat, 18 Apr 2009)
New Revision: 422
Modified:
sandbox/opengeo/geoexplorer/lib/GeoExt/widgets/MapPanel.js
sandbox/opengeo/geoexplorer/modifications.txt
Log:
Give components a chance to do special processing before being added to or removed from a MapPanel (patch for #45).
Modified: sandbox/opengeo/geoexplorer/lib/GeoExt/widgets/MapPanel.js
===================================================================
--- sandbox/opengeo/geoexplorer/lib/GeoExt/widgets/MapPanel.js 2009-04-18 13:46:22 UTC (rev 421)
+++ sandbox/opengeo/geoexplorer/lib/GeoExt/widgets/MapPanel.js 2009-04-18 16:21:32 UTC (rev 422)
@@ -159,6 +159,27 @@
},
/**
+ * Method: onBeforeAdd
+ * Private method called before a component is added to the panel.
+ */
+ onBeforeAdd: function(item) {
+ if(typeof item.addToMap === "function") {
+ item.addToMap(this);
+ }
+ GeoExt.MapPanel.superclass.onBeforeAdd.apply(this, arguments);
+ },
+
+ /**
+ * Method: remove
+ */
+ remove: function(item, autoDestroy) {
+ if(typeof item.removeFromMap === "function") {
+ item.removeFromMap(this);
+ }
+ GeoExt.MapPanel.superclass.remove.apply(this, arguments);
+ },
+
+ /**
* Method: afterRender
* Private method called after the panel has been rendered.
*/
Modified: sandbox/opengeo/geoexplorer/modifications.txt
===================================================================
--- sandbox/opengeo/geoexplorer/modifications.txt 2009-04-18 13:46:22 UTC (rev 421)
+++ sandbox/opengeo/geoexplorer/modifications.txt 2009-04-18 16:21:32 UTC (rev 422)
@@ -12,4 +12,5 @@
* Fixed bug with double-click handling on layertree
* Add reordering support to LegendPanel (geoext #2)
* Rename anchor to anchorPopup (see #44)
+ * Let components do special processing before being added to or removed from a MapPanel (#45)
More information about the Commits
mailing list