Przeglądaj źródła

fixed sidebar and app.js

tags/1.0.0
Robin Thoni 8 lat temu
rodzic
commit
a62a2b99c9

+ 4
- 2
app/app.js Wyświetl plik

@@ -43,7 +43,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationP
43 43
         function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness, $mdDateLocale, $filter) {
44 44
 
45 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 47
                     DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
48 48
                 }
49 49
             });
@@ -55,7 +55,9 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationP
55 55
             };
56 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 63
             $mdDateLocale.firstDayOfWeek = 1;

+ 3
- 7
app/controllers/freeroom.controller.js Wyświetl plik

@@ -3,18 +3,14 @@
3 3
  */
4 4
 
5 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 9
             $scope.dateFormat = DataShareBusiness.DateFormat;
10 10
             $scope.timeFormat = DataShareBusiness.TimeFormat;
11
+
11 12
             $scope.Search = {
12 13
                 Begin: new Date(),
13 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 Wyświetl plik

@@ -44,6 +44,8 @@ angular.module('app')
44 44
             $scope.goTo = function(group)
45 45
             {
46 46
                 if (group != null) {
47
+                    $scope.Search.value = "";
48
+                    console.log(group);
47 49
                     DataShareBusiness.setCurrentGroup(group);
48 50
                 }
49 51
             };

+ 4
- 1
sdk/Business/DataShareBusiness.js Wyświetl plik

@@ -16,6 +16,7 @@
16 16
 
17 17
                 setCurrentGroup: function(group)
18 18
                 {
19
+                    var g = group;
19 20
                     data.CurrentGroups = [];
20 21
                     while (group != null) {
21 22
                         data.CurrentGroups.push(group);
@@ -23,7 +24,9 @@
23 24
                     }
24 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 32
                 getCurrentGroup: function()

Ładowanie…
Anuluj
Zapisz