WordPress/wp-admin/js/postbox.js
2008-01-28 21:34:42 +00:00

12 lines
486 B
JavaScript

function add_postbox_toggles() {
jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
jQuery('.togbox').click( function() { jQuery(jQuery(this).parent().parent().get(0)).toggleClass('closed'); save_postboxes_state(); } );
}
function save_postboxes_state() {
var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');
jQuery.post(postL10n.requestFile, {
action: 'closed-postboxes',
closed: closed,
cookie: document.cookie});
}