(js) Improve calendar lists controller

- preload both lists (events & tasks)
- don't reload list when switching tab
pull/91/head
Francis Lachapelle 2015-07-01 15:17:55 -04:00
parent 35ff82710a
commit cc7eeca2c4
1 changed files with 3 additions and 1 deletions

View File

@ -16,13 +16,15 @@
vm.newComponent = newComponent;
// TODO: should reflect last state userSettings -> Calendar -> SelectedList
vm.selectedList = 0;
vm.selectComponentType('tasks');
vm.selectComponentType('events');
// Switch between components tabs
function selectComponentType(type, options) {
if (options && options.reload || vm.componentType != type) {
// TODO: save user settings (Calendar.SelectedList)
Component.$filter(type);
if (angular.isUndefined(Component['$' + type]))
Component.$filter(type);
vm.componentType = type;
}
}