You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/10/18 01:42:28 UTC
[2/3] git commit: updates url as you type
updates url as you type
Project: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/commit/261263c0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/tree/261263c0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/diff/261263c0
Branch: refs/heads/master
Commit: 261263c02ed7fcec4eb1611f99d15ab7f5381f15
Parents: 4a27d4f
Author: Raymond Camden <ra...@gmail.com>
Authored: Thu Oct 9 13:54:01 2014 -0500
Committer: Raymond Camden <ra...@gmail.com>
Committed: Thu Oct 9 13:54:01 2014 -0500
----------------------------------------------------------------------
attachments/js/directives/topbar.js | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-registry-web/blob/261263c0/attachments/js/directives/topbar.js
----------------------------------------------------------------------
diff --git a/attachments/js/directives/topbar.js b/attachments/js/directives/topbar.js
index 51e0f9f..d64e7b9 100644
--- a/attachments/js/directives/topbar.js
+++ b/attachments/js/directives/topbar.js
@@ -16,6 +16,12 @@ angular.module('registry.controllers').directive('topbar', ['$http', '$location'
SearchService.searchTerm = currentSearch;
currentTerms = currentSearch.trim().split(' ');
+ //handle updating the url for modern browsers
+ if(document.querySelector) {
+ $window.location.href = '/#/search?search='+currentSearch;
+ document.querySelector("#search-text").focus();
+ }
+
//todo: add a short timeout to lower number of requests
currentTerms.forEach(function(term){
if(!searchResults[term]){
@@ -48,6 +54,7 @@ angular.module('registry.controllers').directive('topbar', ['$http', '$location'
}else{
//check to see if user pressed enter or hit submit button
if ((evt.keyCode === 13) || evt.type === "submit" ){
+ console.log('doing this one...');
currentSearch = encodeURIComponent($scope.searchText.toLowerCase());
//send to search page
$window.location.href = '/#/search?search='+currentSearch;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org