]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Don't auto-highlight the search bar on phones
authorGeoff Kimball <geoff@zurb.com>
Tue, 15 Dec 2015 23:20:54 +0000 (15:20 -0800)
committerGeoff Kimball <geoff@zurb.com>
Tue, 15 Dec 2015 23:20:54 +0000 (15:20 -0800)
docs/assets/js/docs.search.js

index 06f9b7b32ae7b297dab2987e7aed16fd130b9b93..820f1a0af822506af66168d1e75c4f17c4fc7b87 100644 (file)
@@ -32,7 +32,11 @@ $('[data-docs-search]')
   .typeahead({ highlight: false }, source)
   .on('typeahead:select', function(e, sel) {
     window.location.href = sel.link;
-  })
-  .focus();
+  });
+
+// Auto-highlight unless it's a phone
+if (!navigator.userAgent.match(/(iP(hone|ad|od)|Android)/)) {
+  $('[data-docs-search]').focus();
+}
 
 }()
\ No newline at end of file