Repository: incubator-zeppelin Updated Branches: refs/heads/master 78c7b5567 -> 3b40c3a48
ZEPPELIN-866] Hotfix - does not working search box on navbar. ### What is this PR for? When you type in the search box and start the search, The result is not exposed. Previously, it was working well. ### What type of PR is it? Hot Fix ### Todos * [x] - fixed bug on navbar.html and controller ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-866 ### How should this be tested? try to search action on navbar. ### Screenshots (if appropriate) #### before <img width="1280" alt="test02" src="https://cloud.githubusercontent.com/assets/10525473/15469402/10713c64-2125-11e6-909d-cb375e7c31a4.png"> #### after <img width="1280" alt="test01" src="https://cloud.githubusercontent.com/assets/10525473/15469411/1a6e0b0c-2125-11e6-9ade-e4147e7143d8.png"> ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: CloverHearts <cloverhearts...@gmail.com> Closes #911 from cloverhearts/fixed/searchbar and squashes the following commits: bca027b [CloverHearts] remove whitespace c592422 [CloverHearts] add space in navbar.controller.js 433139a [CloverHearts] removed event locationChangeSuccess on pr ( does not working search bar) bac1254 [CloverHearts] removed console.log (pr does not working search box) 4d06560 [CloverHearts] Hotfix - dose not working search box on navbar. Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/3b40c3a4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/3b40c3a4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/3b40c3a4 Branch: refs/heads/master Commit: 3b40c3a484393e23894b3699ca29bee08c3e475c Parents: 78c7b55 Author: CloverHearts <cloverhearts...@gmail.com> Authored: Tue May 24 10:59:33 2016 +0900 Committer: Prabhjyot Singh <prabhjyotsi...@gmail.com> Committed: Thu May 26 10:48:27 2016 +0530 ---------------------------------------------------------------------- .../src/components/navbar/navbar.controller.js | 13 ++----------- zeppelin-web/src/components/navbar/navbar.html | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3b40c3a4/zeppelin-web/src/components/navbar/navbar.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js b/zeppelin-web/src/components/navbar/navbar.controller.js index 0e1d150..50c769f 100644 --- a/zeppelin-web/src/components/navbar/navbar.controller.js +++ b/zeppelin-web/src/components/navbar/navbar.controller.js @@ -46,15 +46,6 @@ angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootSco vm.connected = param; }); - $rootScope.$on('$locationChangeSuccess', function () { - var path = $location.path(); - // hacky solution to clear search bar - // TODO(felizbear): figure out how to make ng-click work in navbar - if (path === '/') { - $scope.searchTerm = ''; - } - }); - $scope.checkUsername = function () { if ($rootScope.ticket) { if ($rootScope.ticket.principal.length <= MAX_USERNAME_LENGTH) { @@ -91,8 +82,8 @@ angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootSco }); }; - $scope.search = function() { - $location.url(/search/ + $scope.searchTerm); + $scope.search = function(searchTerm) { + $location.url(/search/ + searchTerm); }; function loadNotes() { http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3b40c3a4/zeppelin-web/src/components/navbar/navbar.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/navbar/navbar.html b/zeppelin-web/src/components/navbar/navbar.html index 70edb21..ebc7dfb 100644 --- a/zeppelin-web/src/components/navbar/navbar.html +++ b/zeppelin-web/src/components/navbar/navbar.html @@ -65,7 +65,7 @@ limitations under the License. <!--TODO(bzz): move to Typeahead https://angular-ui.github.io/bootstrap --> <form role="search" style="width: 300px; display: inline-block; margin: 0 10px" - ng-submit="search()"> + ng-submit="search(searchTerm)"> <div class="input-group"> <input type="text"