r726 - trunk/ui

r726 - trunk/ui


Author: scott.gonzalez
Date: Sat Sep 20 06:49:13 2008
New Revision: 726
Modified:
trunk/ui/ui.core.js
Log:
Core: Fixed #3457: Removing elements causes instantiated plugins to be
destroyed again.
Modified: trunk/ui/ui.core.js
==============================================================================
--- trunk/ui/ui.core.js    (original)
+++ trunk/ui/ui.core.js    Sat Sep 20 06:49:13 2008
@@ -13,7 +13,10 @@
var _remove = $.fn.remove;
$.fn.remove = function() {
-    $("*", this).add(this).triggerHandler("remove");
+    // TODO: add comment about why we can't use .trigger()
+    $("*", this).add(this).each(function() {
+        $(this).triggerHandler("remove");
+    });
    return _remove.apply(this, arguments );
};