2008-02-08 14:57:50 -05:00
|
|
|
function add_postbox_toggles(page) {
|
2008-01-28 16:34:42 -05:00
|
|
|
jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
|
2008-02-08 14:57:50 -05:00
|
|
|
jQuery('.togbox').click( function() { jQuery(jQuery(this).parent().parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
|
2008-01-28 16:34:42 -05:00
|
|
|
}
|
|
|
|
|
2008-02-08 14:57:50 -05:00
|
|
|
function save_postboxes_state(page) {
|
2008-01-28 16:34:42 -05:00
|
|
|
var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');
|
2008-02-02 15:31:56 -05:00
|
|
|
jQuery.post(postboxL10n.requestFile, {
|
2008-01-28 16:34:42 -05:00
|
|
|
action: 'closed-postboxes',
|
|
|
|
closed: closed,
|
2008-02-08 14:57:50 -05:00
|
|
|
closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
|
|
|
|
page: page
|
|
|
|
});
|
|
|
|
}
|