summaryrefslogtreecommitdiffstats
path: root/wp-admin/js/postbox.js
blob: a512f4bcefccffe2848f2808776b1fe0c42f854b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function add_postbox_toggles(page) {
	jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
	jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
}

function save_postboxes_state(page) {
	var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');
	jQuery.post(postboxL10n.requestFile, {
		action: 'closed-postboxes',
		closed: closed,
		closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
		page: page
	});
}