(js) Improve calendar lists controller

- preload both lists (events & tasks)
- don't reload list when switching tab
This commit is contained in:
Francis Lachapelle 2015-07-01 15:17:55 -04:00
parent 35ff82710a
commit cc7eeca2c4

View file

@ -16,12 +16,14 @@
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)
if (angular.isUndefined(Component['$' + type]))
Component.$filter(type);
vm.componentType = type;
}