mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-21 18:48:12 +00:00
Initial work for muliple selections + new toolbar with ops
This commit is contained in:
1 parent
499e66ffe9
commit
7d54bd5e86
9 files changed
+95
-19
No files matched your search
@@ -71,6 +71,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
AddressBook.prototype.$selectedCount = function() {
|
||||
var count;
|
||||
|
||||
count = 0;
|
||||
if (this.cards) {
|
||||
count = (_.filter(this.cards, function(card) { return card.selected })).length;
|
||||
}
|
||||
return count;
|
||||
};
|
||||
|
||||
/**
|
||||
* @memberof AddressBook
|
||||
* @desc Add a new addressbook to the static list of addressbooks
|
||||
@@ -264,6 +274,22 @@
|
||||
return d.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $deleteCards
|
||||
* @memberof AddressBook.prototype
|
||||
* @desc Delete multiple cards from addressbook.
|
||||
* @return a promise of the HTTP operation
|
||||
*/
|
||||
AddressBook.prototype.$deleteCards = function(cards) {
|
||||
|
||||
var uids = _.map(cards, function(card) { return card.id });
|
||||
var _this = this;
|
||||
|
||||
return AddressBook.$$resource.post(this.id, 'batchDelete', {uids: uids}).then(function() {
|
||||
_this.cards = _.difference(_this.cards, cards);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $save
|
||||
* @memberof AddressBook.prototype
|
||||
|
||||
Reference in new issue
Block a user