Hi all!

if you want all the items collapsed, add this line:

if (Drupal.jsEnabled) {
$(document).ready(function(){
$(this).find('.panel-pane > .content').hide();
$('div.panel-display div.panel-pane-collapsible').each(function() {
$(this).find('.panel-pane > h2.title').click(function() {

$(this).toggleClass('collapsed');
$(this).next('.content').toggleClass('collapsed').slideToggle('slow');
});
});
});
}

greetings,

Comments

joachim’s picture

Your jquery selector appears to hit *any* pane, even those without this style applied. Which means there is then no way to expand them again.
So I'm not sure I understand what you mean.
Do you mean that you want all the *collapsible* panes to be initially collapsed?

I've coded the basics for this but I want to make it a setting -- if such a thing is even possible, I'm not sure individual pane styles can have settings. If you can help with that bit of coding it would be appreciated :)

quinti’s picture

Hi Joachim

yes, that is, was my little and not very well solution for get "all the *collapsible* panes to be initially collapsed"

as here: http://www.juarezabogados.es/abogados

at momment i haven't idea for help you..., sorry, when i know, yes

greetings!

julien.reulos’s picture

Hello,
As Quinti I needed that the panes be initially collapsed, but not all of them, just some of those marked as "collapsed" at admin/panels/panel-page/*/edit/content, and then be expanded at the first click.
In order to obtain this behaviour I adapt the panels_collapse.js file to my needs, and it's a manual solution, as it's necessary to list all the panes you want to initially display collapsed:

if (Drupal.jsEnabled) {
  $(document).ready(function(){ 
 // hides the panes content marked with 'collapsed' style, as soon as the DOM is ready
  jQuery('.comment-list > .content').hide();
  jQuery('.comment-form > .content').hide();

    $('div.panel-display div.panel-pane-collapsible').each(function() {  
      $(this).find('.panel-pane > h2.title').click(function() {
          $(this).toggleClass('collapsed');
          $(this).next('.content').toggleClass('collapsed').slideToggle('slow');
        });
    });
  });
}

In my case, I hide 2 panes: the comments list and the comment form of the full node page. The content is hidden but the title is still visible, so that the pane can be expanded.
Many thanks for your module !

WorldFallz’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

not adding new features to d5.