(js) Improve calendar lists controller
- preload both lists (events & tasks) - don't reload list when switching tab
This commit is contained in:
parent
35ff82710a
commit
cc7eeca2c4
|
@ -16,12 +16,14 @@
|
||||||
vm.newComponent = newComponent;
|
vm.newComponent = newComponent;
|
||||||
// TODO: should reflect last state userSettings -> Calendar -> SelectedList
|
// TODO: should reflect last state userSettings -> Calendar -> SelectedList
|
||||||
vm.selectedList = 0;
|
vm.selectedList = 0;
|
||||||
|
vm.selectComponentType('tasks');
|
||||||
vm.selectComponentType('events');
|
vm.selectComponentType('events');
|
||||||
|
|
||||||
// Switch between components tabs
|
// Switch between components tabs
|
||||||
function selectComponentType(type, options) {
|
function selectComponentType(type, options) {
|
||||||
if (options && options.reload || vm.componentType != type) {
|
if (options && options.reload || vm.componentType != type) {
|
||||||
// TODO: save user settings (Calendar.SelectedList)
|
// TODO: save user settings (Calendar.SelectedList)
|
||||||
|
if (angular.isUndefined(Component['$' + type]))
|
||||||
Component.$filter(type);
|
Component.$filter(type);
|
||||||
vm.componentType = type;
|
vm.componentType = type;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue