(js) Don't load item in multi-selection mode

Also review the toolbars of the Calendar module.
This commit is contained in:
Francis Lachapelle
2015-09-09 15:18:00 -04:00
parent 295b53df66
commit 16d312eb98
5 changed files with 235 additions and 215 deletions
@@ -6,8 +6,8 @@
/**
* @ngInject
*/
CalendarListController.$inject = ['$scope', '$timeout', '$state', '$mdDialog', 'encodeUriFilter', 'Dialog', 'Preferences', 'Calendar', 'Component'];
function CalendarListController($scope, $timeout, $state, $mdDialog, encodeUriFilter, Dialog, Preferences, Calendar, Component) {
CalendarListController.$inject = ['$scope', '$timeout', '$state', '$mdDialog', 'Dialog', 'Preferences', 'Calendar', 'Component'];
function CalendarListController($scope, $timeout, $state, $mdDialog, Dialog, Preferences, Calendar, Component) {
var vm = this;
vm.component = Component;
@@ -16,6 +16,7 @@
vm.selectComponentType = selectComponentType;
vm.unselectComponents = unselectComponents;
vm.selectAll = selectAll;
vm.toggleComponentSelection = toggleComponentSelection;
vm.confirmDeleteSelectedComponents = confirmDeleteSelectedComponents;
vm.openEvent = openEvent;
vm.openTask = openTask;
@@ -64,6 +65,12 @@
});
}
function toggleComponentSelection($event, component) {
component.selected = !component.selected;
$event.preventDefault();
$event.stopPropagation();
}
function confirmDeleteSelectedComponents() {
Dialog.confirm(l('Warning'),
l('Are you sure you want to delete the selected components?'))
@@ -101,7 +101,7 @@
count = (_.filter(Component.$events, function(event) { return event.selected; })).length;
}
if (Component.$tasks) {
count = (_.filter(Component.$tasks, function(event) { return event.selected; })).length;
count = (_.filter(Component.$tasks, function(task) { return task.selected; })).length;
}
return count;
};