Index: js/modal_forms.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/panels/js/Attic/modal_forms.js,v
retrieving revision 1.1.2.15
diff -u -p -r1.1.2.15 modal_forms.js
--- js/modal_forms.js	27 May 2008 19:25:57 -0000	1.1.2.15
+++ js/modal_forms.js	14 Jun 2008 23:22:08 -0000
@@ -121,9 +121,14 @@ Drupal.Panels.Subform.bindAjaxResponse =
     $('#panels-modal').unmodalContent();
   }
   else if (data.type == 'replace') {
+    // Replace the HTML in the pane
     $('#panel-pane-' + data.id + ' .panel-pane-collapsible')
-      .html(data.output)
-      .each(Drupal.Panels.bindPortlet);
+      .html(data.output);
+
+    // Re-attach the collapse/expand behavior to the pane.
+    $('#panel-pane-' + data.id).addClass('panel-portlet').each(Drupal.Panels.bindPortlet);
+
+    // Mark that this pane has been changed.
     Drupal.Panels.changed($('#panel-pane-' + data.id));
 
     // dismiss the dialog
