malteo/bootstrap-collapsible-fieldset

+/- sign does not toggle

Opened this issue · 0 comments

Hi,

I used your code and everything works fine - except for the signs which do not change after the first time (from '+' to '-', but won't change back).

I wrote a fix for that:

$(function () {
    $('fieldset.collapsible > legend').append(' (<span style="font-family: monospace;">+</span>)');
    $('fieldset.collapsible > legend').click(function () {
        var $divs = $(this).siblings();
        $divs.toggle();

        $(this).find('span').text(function () {
            return ($divs.first().is(':visible')) ? '+' : '-';
        });
    });
});

Best regards
Steven