mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-08 11:59:44 +00:00
(feat) initial selection + ops in calendar module
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
vm.componentType = 'events';
|
||||
vm.selectedList = 0;
|
||||
vm.selectComponentType = selectComponentType;
|
||||
vm.unselectComponents = unselectComponents;
|
||||
vm.selectAll = selectAll;
|
||||
vm.confirmDeleteSelectedComponents = confirmDeleteSelectedComponents;
|
||||
vm.openEvent = openEvent;
|
||||
vm.openTask = openTask;
|
||||
vm.newComponent = newComponent;
|
||||
@@ -45,11 +48,34 @@
|
||||
// TODO: save user settings (Calendar.SelectedList)
|
||||
if (angular.isUndefined(Component['$' + type]))
|
||||
Component.$filter(type);
|
||||
vm.unselectComponents();
|
||||
vm.componentType = type;
|
||||
Component.saveSelectedList(type);
|
||||
}
|
||||
}
|
||||
|
||||
function unselectComponents() {
|
||||
_.each(Component['$' + vm.componentType], function(component) { component.selected = false; });
|
||||
}
|
||||
|
||||
function selectAll() {
|
||||
_.each(Component['$' + vm.componentType], function(component) {
|
||||
component.selected = true;
|
||||
});
|
||||
}
|
||||
|
||||
function confirmDeleteSelectedComponents() {
|
||||
Dialog.confirm(l('Warning'),
|
||||
l('Are you sure you want to delete the selected components?'))
|
||||
.then(function() {
|
||||
// User confirmed the deletion
|
||||
var components = _.filter(Component['$' + vm.componentType], function(component) { return component.selected; });
|
||||
Calendar.$deleteComponents(components);
|
||||
}, function(data, status) {
|
||||
// Delete failed
|
||||
});
|
||||
}
|
||||
|
||||
function openEvent($event, event) {
|
||||
openComponent($event, event, 'appointment');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user