function do_action(action) { $('div.actions option[selected]').attr('selected', ''); $('div.actions option[value='+action+']').attr('selected', 'selected'); $("div.actions").parent().submit(); } function fix_actions() { $('th.action-checkbox-column:first').prepend('select
all
'); if ($('div.actions option:gt(0)').length<=8) { // Only do this for short lists. Probably need to tweak this number. $('div.actions label, div.actions button').hide(); actions_html='
'; $('div.actions option:gt(0)').each(function(i) { actions_html+=''+this.text+''; }); actions_html+='
'; $('div.actions').append(actions_html); } }