diff --git a/UI/WebServerResources/js/Scheduler/CalendarListController.js b/UI/WebServerResources/js/Scheduler/CalendarListController.js index 91af545aa..bc7092b58 100644 --- a/UI/WebServerResources/js/Scheduler/CalendarListController.js +++ b/UI/WebServerResources/js/Scheduler/CalendarListController.js @@ -34,6 +34,11 @@ selectComponentType(type, { reload: true }); }); + // Refresh current list when the list of calendars is modified + $scope.$on('calendars:list', function() { + Component.$filter(vm.componentType, { reload: true }); + }); + // Switch between components tabs function selectComponentType(type, options) { if (options && options.reload || vm.componentType != type) { @@ -114,11 +119,6 @@ vm.mode.search = false; Component.$filter(vm.componentType, { value: '' }); } - - // Refresh current list when the list of calendars is modified - $scope.$on('calendars:list', function() { - Component.$filter(vm.componentType); - }); } angular diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index d4c57ad76..bd5d06989 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -103,8 +103,10 @@ _.each(_.keys(options), function(key) { // Query parameters common to events and tasks are compared dirty |= (_this.$query[key] && options[key] != Component.$query[key]); + if (key == 'reload' && options[key]) + dirty = true; // Update either the common parameters or the type-specific parameters - if (angular.isDefined(_this.$query[key])) + else if (angular.isDefined(_this.$query[key])) _this.$query[key] = options[key]; else _this[queryKey][key] = options[key];