deselect all

This commit is contained in:
Matchu 2015-09-26 19:58:31 -07:00
parent e6a2b978f1
commit e4757b0ee4
2 changed files with 10 additions and 4 deletions

View file

@ -398,10 +398,9 @@
data: data,
success: function (html) {
var doc = $(html);
maintainCheckboxes(function() {
hangersEl.html( doc.find('#closet-hangers').html() );
hangersInit();
});
hangersEl.html( doc.find('#closet-hangers').html() );
hangersInit();
updateBulkActions(); // don't want to maintain checked; deselect em all
doc.find('.flash').hide().insertBefore(hangersEl).show(500).delay(5000).hide(250);
itemsSearchField.val("");
},
@ -436,6 +435,11 @@
});
});
$(".bulk-actions-deselect-all").bind("click", function(e) {
getCheckboxes().filter(':checked').attr('checked', false);
updateBulkActions();
});
function maintainCheckboxes(fn) {
var checkedIds = getCheckedIds();

View file

@ -77,6 +77,8 @@
%li
= form_tag user_closet_hangers_path(@user), method: :delete, class: 'bulk-actions-remove-all' do
%button Remove all
%li
%button.bulk-actions-deselect-all Deselect all
#closet-hangers{:class => public_perspective? ? nil : 'current-user'}
- [true, false].each do |owned|