Skip to content

Commit

Permalink
Delegate the collapsing of fieldsets so that even if they are created…
Browse files Browse the repository at this point in the history
… dynamically can be collapsed as all the others - fixes #2153

Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Jul 25, 2015
1 parent 39af544 commit 58c9481
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions themes/default/scripts/theme.js
Expand Up @@ -53,10 +53,11 @@ $(document).ready(function() {
$('.expand_pages').expand_pages();

// Collapsabile fieldsets, pure candy
$('legend').click(function(){
$(document).on('click', 'legend', function(){
$(this).siblings().slideToggle("fast");
$(this).parent().toggleClass("collapsed");
}).each(function () {
})
$(document).on('ready', 'legend', function () {
if ($(this).data('collapsed'))
$(this).click();
});
Expand Down

0 comments on commit 58c9481

Please sign in to comment.