| 1 |
jQuery(function($){ |
| 2 |
function performAutosave(){ |
| 3 |
var panel = $(this).parents('div.custom-options-panel'); |
| 4 |
var params = panel.find('input, select, textarea').serialize(); |
| 5 |
params = params + '&action=save_settings-' + panel.attr('id'); |
| 6 |
$.post( |
| 7 |
'admin-ajax.php', |
| 8 |
params |
| 9 |
); |
| 10 |
} |
| 11 |
|
| 12 |
$('#screen-options-wrap div.requires-autosave').find('input, select, textarea').on( 'change', performAutosave); |
| 13 |
}); |