diff --git a/panels_ipe/js/panels_ipe.js b/panels_ipe/js/panels_ipe.js index b203f5e..a628357 100644 --- a/panels_ipe/js/panels_ipe.js +++ b/panels_ipe/js/panels_ipe.js @@ -264,6 +264,10 @@ function DrupalPanelsIPE(cache_key, cfg) { // Re-show all the IPE non-editing meta-elements $('div.panels-ipe-off').show('fast'); + // Refresh the container and control jQuery objects. + ipe.container = $(ipe.container.selector); + ipe.control = $(ipe.control.selector); + ipe.showButtons(); // Re-hide all the IPE meta-elements $('div.panels-ipe-on').hide(); diff --git a/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php b/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php index c959a6d..5fa1d29 100644 --- a/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php +++ b/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php @@ -284,6 +284,13 @@ class panels_renderer_ipe extends panels_renderer_editor { // rendered. $this->meta_location = 'inline'; $this->commands[] = ajax_command_replace("#panels-ipe-display-{$this->clean_key}", panels_render_display($this->display, $this)); + + // Meta method has been run, however we're not rebuilding the entire page. + // That means the buttons have a stale cache ID and need to be rebuilt. + $buttons = &drupal_static('panels_ipe_toolbar_buttons', array()); + $output = theme('panels_ipe_toolbar', array('buttons' => $buttons)); + $this->commands[] = ajax_command_replace('#panels-ipe-control-container', $output); + } else { // Cancelled. Clear the cache.