Fixed arrows down on init

This commit is contained in:
Benjamin Athlan 2011-05-16 22:07:00 +02:00
parent 32b7f36fe2
commit b1819af066

View File

@ -4,17 +4,20 @@ $(document).ready(function() {
$('#pages-list ul.folder img.toggler').click(function(e) {
var toggler = $(this);
var children = toggler.parent().find('> ul.folder');
if (children.is(':visible')) {
children.slideUp('fast', function() {
toggler.attr('src', toggler.attr('src').replace('open', 'closed'));
$.cookie(children.attr('id'), 'none');
});
} else {
children.slideDown('fast', function() {
toggler.attr('src', toggler.attr('src').replace('closed', 'open'));
$.cookie(children.attr('id'), 'block');
});
}
children.each(function(){
if ($(this).is(':visible')) {
$(this).slideUp('fast', function() {
toggler.attr('src', toggler.attr('src').replace('open', 'closed'));
$.cookie($(this).attr('id'), 'none');
});
} else {
$(this).slideDown('fast', function() {
toggler.attr('src', toggler.attr('src').replace('closed', 'open'));
$.cookie($(this).attr('id'), 'block');
});
}
});
});
// sortable folder items