|
@@ -1,6 +1,6 @@
|
1
|
1
|
angular.module('app')
|
2
|
|
- .controller('HomeController', ['$scope', '$state', 'DataShareBusiness', 'WeeksBusiness', '$mdDialog',
|
3
|
|
- function($scope, $state, DataShareBusiness, WeeksBusiness, $mdDialog) {
|
|
2
|
+ .controller('HomeController', ['$scope', '$state', 'DataShareBusiness', 'WeeksBusiness', '$mdDialog', '$location',
|
|
3
|
+ function($scope, $state, DataShareBusiness, WeeksBusiness, $mdDialog, $location) {
|
4
|
4
|
|
5
|
5
|
$scope.DataShareBusiness = DataShareBusiness;
|
6
|
6
|
$scope.dateFormat = DataShareBusiness.DateFormat;
|
|
@@ -140,6 +140,11 @@ angular.module('app')
|
140
|
140
|
return Math.round(($scope.getMonday(date1) - $scope.getMonday(date2)) / 604800000)
|
141
|
141
|
};
|
142
|
142
|
|
|
143
|
+ $scope.$watch(function(){return DataShareBusiness.Groups}, function()
|
|
144
|
+ {
|
|
145
|
+ DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
|
|
146
|
+ });
|
|
147
|
+
|
143
|
148
|
$scope.$watch(function(){return DataShareBusiness.CurrentGroups}, $scope.loadWeeks);
|
144
|
149
|
|
145
|
150
|
$scope.$watch(function(){return $scope.selectedDate}, function(newValue, oldValue)
|
|
@@ -153,6 +158,12 @@ angular.module('app')
|
153
|
158
|
}
|
154
|
159
|
});
|
155
|
160
|
|
|
161
|
+ $scope.$watch(function(){ return $location.search().group }, function(){
|
|
162
|
+ if (DataShareBusiness.Groups != null) {
|
|
163
|
+ DataShareBusiness.setFromSearchString($location.search().group);
|
|
164
|
+ }
|
|
165
|
+ });
|
|
166
|
+
|
156
|
167
|
$scope.goToRelativeWeek = function(relativeWeek)
|
157
|
168
|
{
|
158
|
169
|
$scope.selectedDate.setDate($scope.selectedDate.getDate() + (relativeWeek * 7));
|