Set the location/path on search
authorJan Lahoda <jlahoda@netbeans.org>
Mon, 23 Sep 2013 00:12:26 +0200
changeset 980959b334f0802
parent 979 3f3c0fba02c8
child 981 7a90e7046bd6
Set the location/path on search
remoting/server/web/web.ui.frontend/public_html/index/ui/index.html
remoting/server/web/web.ui.frontend/public_html/index/ui/script.js
     1.1 --- a/remoting/server/web/web.ui.frontend/public_html/index/ui/index.html	Mon Sep 23 00:06:32 2013 +0200
     1.2 +++ b/remoting/server/web/web.ui.frontend/public_html/index/ui/index.html	Mon Sep 23 00:12:26 2013 +0200
     1.3 @@ -24,7 +24,7 @@
     1.4              });
     1.5              $routeProvider.otherwise({
     1.6                  templateUrl: 'search.html',
     1.7 -                controller: DeclarationSearch
     1.8 +                controller: IndexDeclarationSearch
     1.9              });
    1.10  
    1.11              // configure html5 to get links working on jsfiddle
     2.1 --- a/remoting/server/web/web.ui.frontend/public_html/index/ui/script.js	Mon Sep 23 00:06:32 2013 +0200
     2.2 +++ b/remoting/server/web/web.ui.frontend/public_html/index/ui/script.js	Mon Sep 23 00:12:26 2013 +0200
     2.3 @@ -1,6 +1,14 @@
     2.4 +function IndexDeclarationSearch($scope, $location, $http, $routeParams, $route) {
     2.5 +    DeclarationSearch($scope, $location, $http, $routeParams, $route);
     2.6 +    $scope.performQuery = function() {
     2.7 +        $location.url("/search?prefix=" + $scope.prefix);
     2.8 +        //no need to do the actual query - it will be done automatically when the route changes
     2.9 +    };
    2.10 +}
    2.11  function DeclarationSearch($scope, $location, $http, $routeParams, $route) {
    2.12      $scope.performQuery = function() {
    2.13          $scope.$parent.loading = true;
    2.14 +        $location.url("/search?prefix=" + $scope.prefix);
    2.15          $http.get('/index/ui/searchSymbol?prefix=' + $scope.prefix).success(function(data) {
    2.16              var result = [];
    2.17              var index = 0;