Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C845173FF for ; Fri, 17 Oct 2014 23:42:28 +0000 (UTC) Received: (qmail 37784 invoked by uid 500); 17 Oct 2014 23:42:28 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 37666 invoked by uid 500); 17 Oct 2014 23:42:28 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 37644 invoked by uid 99); 17 Oct 2014 23:42:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Oct 2014 23:42:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E52A29C7546; Fri, 17 Oct 2014 23:42:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Fri, 17 Oct 2014 23:42:28 -0000 Message-Id: <5b11cd84e5db4e8cacf7f88957a74430@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Thu Oct 9 13:54:01 2014 -0500 Committer: Raymond Camden 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