(feat) initial selection + ops in calendar module

This commit is contained in:
Ludovic Marcotte
2015-08-12 16:11:38 -04:00
parent 54334b294e
commit 47252affba
4 changed files with 99 additions and 4 deletions
@@ -86,9 +86,28 @@
angular.module('SOGo.SchedulerUI')
.factory('Component', Component.$factory);
/**
* @function $selectedCount
* @memberof Component
* @desc Return the number of events or tasks selected by the user.
* @returns the number of selected events or tasks
*/
Component.$selectedCount = function() {
var count;
count = 0;
if (Component.$events) {
count = (_.filter(Component.$events, function(event) { return event.selected; })).length;
}
if (Component.$tasks) {
count = (_.filter(Component.$tasks, function(event) { return event.selected; })).length;
}
return count;
};
/**
* @function $filter
* @memberof Component.prototype
* @memberof Component
* @desc Search for components matching some criterias
* @param {string} type - either 'events' or 'tasks'
* @param {object} [options] - additional options to the query
@@ -403,6 +422,8 @@
_this.updateFreeBusy(attendee);
});
}
this.selected = false;
};
/**