[icinga-checkins] icinga.org: icinga-web/support/1.10: Ext: Add non-leaking override for `TreeNode::removeChild()'

git at icinga.org git at icinga.org
Fri Jun 6 08:37:28 CEST 2014


Module: icinga-web
Branch: support/1.10
Commit: c192e34cef93b0203f0c86c6adec49c83c927f2a
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=c192e34cef93b0203f0c86c6adec49c83c927f2a

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Thu Jun  5 11:18:44 2014 +0200

Ext: Add non-leaking override for `TreeNode::removeChild()'

---

 app/modules/AppKit/config/javascript.xml                    |   10 ++++++----
 app/modules/AppKit/lib/js/ext-overrides/TreeNodeDontLeak.js |   11 +++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/app/modules/AppKit/config/javascript.xml b/app/modules/AppKit/config/javascript.xml
index 4cee384..81a48bc 100644
--- a/app/modules/AppKit/config/javascript.xml
+++ b/app/modules/AppKit/config/javascript.xml
@@ -36,7 +36,7 @@
             <ae:parameter>%core.module_dir%/AppKit/lib/js/ux/EllipsisColumn.js</ae:parameter>
             <ae:parameter>%core.module_dir%/AppKit/lib/js/search/AppKitSearchBox.js</ae:parameter>
             <ae:parameter>%core.module_dir%/AppKit/lib/js/search/AppKitSearchHandler.js</ae:parameter>
-            
+
             <!-- Admin interface components -->
             <ae:parameter>%core.module_dir%/AppKit/lib/js/admin/components/RoleListingGrid.js</ae:parameter>
             <ae:parameter>%core.module_dir%/AppKit/lib/js/admin/components/UserListingGrid.js</ae:parameter>
@@ -54,11 +54,13 @@
             <ae:parameter>%core.module_dir%/AppKit/lib/js/admin/RoleManager.js</ae:parameter>
 
             <ae:parameter>%core.module_dir%/AppKit/lib/js/ux/SmartUpdateGrid.js</ae:parameter>
-            
+
             <!-- jsgettext -->
             <ae:parameter>%core.root_dir%/lib/jsgettext/lib/Gettext.js</ae:parameter>
+
+            <ae:parameter>%core.module_dir%/AppKit/lib/js/ext-overrides/TreeNodeDontLeak.js</ae:parameter>
         </javascript>
-        
+
 <!--
     * Method is deprecated
          <jactions>
@@ -69,6 +71,6 @@
             </jaction>
         </jactions>
 -->
-        
+
     </ae:configuration>
 </ae:configurations>
diff --git a/app/modules/AppKit/lib/js/ext-overrides/TreeNodeDontLeak.js b/app/modules/AppKit/lib/js/ext-overrides/TreeNodeDontLeak.js
new file mode 100644
index 0000000..1126754
--- /dev/null
+++ b/app/modules/AppKit/lib/js/ext-overrides/TreeNodeDontLeak.js
@@ -0,0 +1,11 @@
+(function () {
+    'use strict';
+    var removeChild = Ext.tree.TreeNode.prototype.removeChild;
+    Ext.override(Ext.tree.TreeNode, {
+        removeChild: function () {
+            var node = removeChild.apply(this, arguments);
+            this.ownerTree.unregisterNode(node);
+            return node;
+        }
+    });
+}());



More information about the icinga-checkins mailing list