Related to issue 23761: Refactored destroyAndRemoveMembers function
authorAugusto Mauch <augusto.mauch@openbravo.com>
Sun, 12 May 2013 23:07:30 +0200
changeset 20318 fdad1b48e5c6
parent 20317 1af15068e1b5
child 20319 509313c46b30
Related to issue 23761: Refactored destroyAndRemoveMembers function

The function has been modified so that it removes the members the layout before destroying them.
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Sun May 12 22:16:11 2013 +0430
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Sun May 12 23:07:30 2013 +0200
@@ -99,11 +99,11 @@
 isc.Layout.addProperties({
 
   destroyAndRemoveMembers: function (toDestroy) {
-    var i, len, toDestroyCopy, nextIndex = 0;
+    var i, len, nextIndex = 0;
     if (!isc.isA.Array(toDestroy)) {
       toDestroy = [toDestroy];
     }
-    toDestroyCopy = isc.shallowClone(toDestroy);
+    this.removeMembers(toDestroy);
     len = toDestroy.length;
     for (i = 0; i < len; i++) {
       if (toDestroy[nextIndex] && toDestroy[nextIndex].destroy) {
@@ -113,7 +113,6 @@
         nextIndex = nextIndex + 1;
       }
     }
-    this.removeMembers(toDestroyCopy);
   }
 });