|
1 | 1 | /* |
2 | | - * Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | + * Licensed under the Apache License, Version 2.0 (the 'License'); |
3 | 3 | * you may not use this file except in compliance with the License. |
4 | 4 | * You may obtain a copy of the License at |
5 | 5 | * |
6 | 6 | * http://www.apache.org/licenses/LICENSE-2.0 |
7 | 7 | * |
8 | 8 | * Unless required by applicable law or agreed to in writing, software |
9 | | - * distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | + * distributed under the License is distributed on an 'AS IS' BASIS, |
10 | 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
11 | 11 | * See the License for the specific language governing permissions and |
12 | 12 | * limitations under the License. |
@@ -34,6 +34,17 @@ angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootSco |
34 | 34 | vm.connected = param; |
35 | 35 | }); |
36 | 36 |
|
| 37 | + $rootScope.$on('$locationChangeSuccess', function () { |
| 38 | + var path = $location.path(); |
| 39 | + // felizbear: |
| 40 | + // this is a somewhat hacky solution to clear search bar, |
| 41 | + // as I couldn't figure out how to make ng-click work in navbar |
| 42 | + // on the other hand, what is not hacky in current zeppelin-web ;) |
| 43 | + if (path === '/') { |
| 44 | + $scope.searchTerm = ''; |
| 45 | + } |
| 46 | + }); |
| 47 | + |
37 | 48 | $scope.search = function() { |
38 | 49 | $location.url(/search/ + $scope.searchTerm); |
39 | 50 | }; |
|
0 commit comments