2011-05-18 16:27:24 +00:00
|
|
|
/**
|
2011-07-05 19:03:10 +00:00
|
|
|
* Version 1.0.1
|
2011-05-18 16:27:24 +00:00
|
|
|
* Init and deploy childs on menu (admin)
|
|
|
|
* Benjamin Athlan - Bewcultures
|
2011-07-05 19:03:10 +00:00
|
|
|
* Andrew Bennett - Delorum
|
2011-05-18 16:27:24 +00:00
|
|
|
*/
|
|
|
|
$.fn.toggleMe = function(settings) {
|
|
|
|
|
2011-07-05 19:03:10 +00:00
|
|
|
settings = $.extend({}, settings);
|
|
|
|
|
|
|
|
var toggle = function(event) {
|
|
|
|
var toggler = $(this);
|
|
|
|
var children = toggler.parent().find('> ul.folder');
|
2011-05-18 16:27:24 +00:00
|
|
|
|
2011-07-05 19:03:10 +00:00
|
|
|
children.each(function() {
|
|
|
|
var child = $(this);
|
|
|
|
if (child.is(':visible')) {
|
|
|
|
child.slideUp('fast', function() {
|
|
|
|
toggler.attr('src', toggler.attr('src').replace('open', 'closed'));
|
|
|
|
$.cookie(child.attr('id'), 'none');
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
child.slideDown('fast', function() {
|
|
|
|
toggler.attr('src', toggler.attr('src').replace('closed', 'open'));
|
|
|
|
$.cookie(child.attr('id'), 'block');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2011-05-18 16:27:24 +00:00
|
|
|
|
2011-07-05 19:03:10 +00:00
|
|
|
return $(this).bind("click", toggle);
|
2011-05-18 16:27:24 +00:00
|
|
|
|
2011-07-05 19:03:10 +00:00
|
|
|
};
|