diff --git a/panels_ipe/js/panels_ipe.js b/panels_ipe/js/panels_ipe.js index 279c366..89d1d72 100644 --- a/panels_ipe/js/panels_ipe.js +++ b/panels_ipe/js/panels_ipe.js @@ -36,6 +36,9 @@ Drupal.behaviors.PanelsIPE = { .each(function() { Drupal.PanelsIPE.editors[key] = new DrupalPanelsIPE(key); Drupal.PanelsIPE.editors[key].showContainer(); + $('.panels-ipe-hide-bar').once('panels-ipe-hide-bar-processed').click(function() { + Drupal.PanelsIPE.editors[key].hideContainer(); + }); }); } Drupal.PanelsIPE.bindClickDelete(context); @@ -81,6 +84,12 @@ function DrupalPanelsIPE(cache_key, cfg) { ipe.showContainer(); ipe.cancelLock(); } + + // If the IPE is on and we've hidden the bar for a modal, we need to + // re-display it. + if (ipe.topParent && ipe.topParent.hasClass('panels-ipe-editing') && ipe.container.is(':not(visible)')) { + ipe.showContainer(); + } }); // If a user navigates away from a locked IPE, cancel the lock in the background. diff --git a/panels_ipe/panels_ipe.module b/panels_ipe/panels_ipe.module index a305323..5c0b4c8 100644 --- a/panels_ipe/panels_ipe.module +++ b/panels_ipe/panels_ipe.module @@ -89,7 +89,7 @@ function theme_panels_ipe_pane_wrapper($vars) { 'href' => $renderer->get_url('edit-pane', $pane->pid), 'html' => TRUE, 'attributes' => array( - 'class' => 'ctools-use-modal', + 'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'), 'title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'), // 'id' => "pane-edit-panel-pane-$pane->pid", ), @@ -103,7 +103,7 @@ function theme_panels_ipe_pane_wrapper($vars) { 'href' => $renderer->get_url('style-type', 'pane', $pane->pid), 'html' => TRUE, 'attributes' => array( - 'class' => array('ctools-use-modal'), + 'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'), 'title' => t('Style'), ), ); @@ -147,7 +147,7 @@ function theme_panels_ipe_add_pane_button($vars) { $display = $vars['display']; $renderer = $vars['renderer']; - $attributes = array('class' => 'ctools-use-modal'); + $attributes = array('class' =>array('ctools-use-modal', 'panels-ipe-hide-bar')); $link = l(t('Add new pane'), $renderer->get_url('select-content', $region_id), array('attributes' => $attributes)); return '
' . $link . '
'; }