Browse Source

fixed sidebar and app.js

tags/1.0.0
Robin Thoni 8 years ago
parent
commit
a62a2b99c9

+ 4
- 2
app/app.js View File

43
         function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness, $mdDateLocale, $filter) {
43
         function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness, $mdDateLocale, $filter) {
44
 
44
 
45
             $rootScope.$watch(function(){ return Object.keys($location.search())[0] }, function(){
45
             $rootScope.$watch(function(){ return Object.keys($location.search())[0] }, function(){
46
-                if (DataShareBusiness.Groups != null) {
46
+                if (DataShareBusiness.Groups != null && $state.current.name == "home") {
47
                     DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
47
                     DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
48
                 }
48
                 }
49
             });
49
             });
55
             };
55
             };
56
             GroupsBusiness.loadAll(promiseLoadGroups).then(function(data)
56
             GroupsBusiness.loadAll(promiseLoadGroups).then(function(data)
57
             {
57
             {
58
-                DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
58
+                if ($state.current.name == "home") {
59
+                    DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
60
+                }
59
             });
61
             });
60
 
62
 
61
             $mdDateLocale.firstDayOfWeek = 1;
63
             $mdDateLocale.firstDayOfWeek = 1;

+ 3
- 7
app/controllers/freeroom.controller.js View File

3
  */
3
  */
4
 
4
 
5
 angular.module('app')
5
 angular.module('app')
6
-    .controller('FreeRoomController', ['$scope', '$mdDialog', 'DataShareBusiness',
7
-        function($scope, $mdDialog, DataShareBusiness) {
6
+    .controller('FreeRoomController', ['$scope', 'DataShareBusiness',
7
+        function($scope, DataShareBusiness) {
8
 
8
 
9
             $scope.dateFormat = DataShareBusiness.DateFormat;
9
             $scope.dateFormat = DataShareBusiness.DateFormat;
10
             $scope.timeFormat = DataShareBusiness.TimeFormat;
10
             $scope.timeFormat = DataShareBusiness.TimeFormat;
11
+
11
             $scope.Search = {
12
             $scope.Search = {
12
                 Begin: new Date(),
13
                 Begin: new Date(),
13
                 End: new Date()
14
                 End: new Date()
14
             };
15
             };
15
-
16
-            $scope.close = function()
17
-            {
18
-                $mdDialog.cancel();
19
-            };
20
         }]);
16
         }]);

+ 2
- 0
app/controllers/sidebar.controller.js View File

44
             $scope.goTo = function(group)
44
             $scope.goTo = function(group)
45
             {
45
             {
46
                 if (group != null) {
46
                 if (group != null) {
47
+                    $scope.Search.value = "";
48
+                    console.log(group);
47
                     DataShareBusiness.setCurrentGroup(group);
49
                     DataShareBusiness.setCurrentGroup(group);
48
                 }
50
                 }
49
             };
51
             };

+ 4
- 1
sdk/Business/DataShareBusiness.js View File

16
 
16
 
17
                 setCurrentGroup: function(group)
17
                 setCurrentGroup: function(group)
18
                 {
18
                 {
19
+                    var g = group;
19
                     data.CurrentGroups = [];
20
                     data.CurrentGroups = [];
20
                     while (group != null) {
21
                     while (group != null) {
21
                         data.CurrentGroups.push(group);
22
                         data.CurrentGroups.push(group);
23
                     }
24
                     }
24
                     data.CurrentGroups.reverse();
25
                     data.CurrentGroups.reverse();
25
 
26
 
26
-                    $location.search(data.getSearchString(-1));
27
+                    $state.go('home').then(function() {
28
+                        $location.search(data.getSearchString(-1));
29
+                    });
27
                 },
30
                 },
28
 
31
 
29
                 getCurrentGroup: function()
32
                 getCurrentGroup: function()

Loading…
Cancel
Save