[Commits] r1610 - core/trunk/geoext/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Thu Dec 24 23:09:42 CET 2009


Author: ahocevar
Date: 2009-12-24 23:09:41 +0100 (Thu, 24 Dec 2009)
New Revision: 1610

Modified:
   core/trunk/geoext/lib/GeoExt/widgets/Action.js
Log:
made safeCallEach even safer by making sure that a button is only toggled when it is rendered. r=bartvde (closes #188)

Modified: core/trunk/geoext/lib/GeoExt/widgets/Action.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/Action.js	2009-12-24 18:46:52 UTC (rev 1609)
+++ core/trunk/geoext/lib/GeoExt/widgets/Action.js	2009-12-24 22:09:41 UTC (rev 1610)
@@ -215,7 +215,12 @@
         var cs = this.items;
         for(var i = 0, len = cs.length; i < len; i++){
             if(cs[i][fnName]) {
-                cs[i][fnName].apply(cs[i], args);
+                cs[i].rendered ?
+                    cs[i][fnName].apply(cs[i], args) :
+                    cs[i].on({
+                        "render": cs[i][fnName].createDelegate(cs[i], args),
+                        single: true
+                    });
             }
         }
     }



More information about the Commits mailing list