Author: erinnp
Date: Fri Mar 29 20:19:07 2013
New Revision: 1462631

URL: http://svn.apache.org/r1462631
Log:
Fixed a zombie views issue with rave popups


Modified:
    
rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js

Modified: 
rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
URL: 
http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js?rev=1462631&r1=1462630&r2=1462631&view=diff
==============================================================================
--- 
rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
 (original)
+++ 
rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
 Fri Mar 29 20:19:07 2013
@@ -805,7 +805,7 @@ _.extend(rave.ui, (function () {
                 cleanup: function (content) {
                     var container = content.parents(this.containerSelector);
                     container.hide("slide", { direction: "right" }, 'fast', 
function () {
-                        container.detach();
+                        container.remove();
                         $('body').removeClass('modal-open');
                         $('.modal-backdrop').remove();
                         // restore the main browser window's scrollbar
@@ -851,7 +851,7 @@ _.extend(rave.ui, (function () {
                     container.modal(cfg);
 
                     container.on('hidden', function () {
-                        container.detach();
+                        container.remove();
                     })
                 },
                 cleanup: function (content) {
@@ -864,11 +864,14 @@ _.extend(rave.ui, (function () {
         };
 
         _.each(POPUPS, function (target) {
-            var $container = $(rave.ui.templates[target.template]());
-            var $site = $(target.contentSelector, $container);
+            var $container,
+                $site;
 
             rave.registerView(target.name, {
                 render: function (prefs) {
+                    $container = $(rave.ui.templates[target.template]());
+                    $site = $(target.contentSelector, $container);
+
                     var height = (prefs && prefs.preferredHeight);
                     var width = (prefs && prefs.preferredWidth);
                     if (height) {
@@ -892,7 +895,7 @@ _.extend(rave.ui, (function () {
                         target.cleanup($site);
                     }
                     else {
-                        $container.detach();
+                        $container.remove();
                     }
                 }
             });


Reply via email to