diff --git a/panels_ipe/js/panels_ipe.js b/panels_ipe/js/panels_ipe.js index 279c366..5182c2d 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').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 5ada7e2..df64fc4 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'), ), ); @@ -152,7 +152,7 @@ function theme_panels_ipe_add_pane_button($vars) { if (user_access('administer panels styles')) { $link .= ' ' . l('' . t('Region style') . '', $renderer->get_url('style-type', 'region', $region_id), array( 'attributes' => array( - 'class' => array('ctools-use-modal', 'style'), + 'class' => array('ctools-use-modal', 'panels-ipe-hide-bar', 'style'), 'title' => t('Region style'), ), 'html' => TRUE, @@ -162,7 +162,7 @@ function theme_panels_ipe_add_pane_button($vars) { // Add option to add items in the IPE $link .= ' ' . l('' . t('Add new pane') . '', $renderer->get_url('select-content', $region_id), array( 'attributes' => array( - 'class' => array('ctools-use-modal', 'add'), + 'class' => array('ctools-use-modal', 'panels-ipe-hide-bar', 'add'), 'title' => t('Add new pane'), ), 'html' => TRUE,