diff --git a/public/css/style.css b/public/css/style.css index 9e4ac93f..17ae4285 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -5535,6 +5535,15 @@ a[data-pro]:hover:after { background: rgba(0, 0, 0, 0.04); } +#result-count { + color: #aaa; + left: -80px; + position: relative; + text-align: right; + width: 60px; + display: inline-block; +} + #results a { display: block; overflow: hidden; diff --git a/public/js/chrome/help-search.js b/public/js/chrome/help-search.js index c86638d9..ae79c3e1 100644 --- a/public/js/chrome/help-search.js +++ b/public/js/chrome/help-search.js @@ -1,16 +1,22 @@ (function () { 'use strict'; var results = $('#results'); + var resultCount = $('#result-count'); var searchTerms = []; var search = $('#helpsearch'); var position = -1; search.on('input', throttle(function () { if (searchTerms.length === 0) { - $.getJSON('/help/search.json', function (data) { - searchTerms = data; - searchFor(this.value, searchTerms); - }.bind(this)); + $.ajax({ + url: '/help/search.json?' + (new Date()).toString().split(' ').slice(0, 4).join('-'), + dataType: 'json', + cache: true, + success: function (data) { + searchTerms = data; + searchFor(this.value, searchTerms); + }.bind(this) + }); } else { searchFor(this.value, searchTerms); } @@ -64,9 +70,9 @@ } }); - search.on('focus', function () { - results.hide(); - }); + // search.on('focus', function () { + // results.hide(); + // }); function wordmap(input) { var ignore = "a an and on in it of if for the i is i'm i'd it's or to me be not was do so at are what bin bins".split(' '); @@ -121,6 +127,11 @@ }).join('\n')); results.show(); + var s = ''; + if (matches.length !== 1) { + s = 's'; + } + resultCount.html(matches.length + ' result' + s); } diff --git a/public/js/chrome/navigation.js b/public/js/chrome/navigation.js index 713dd5d6..9cc89c6b 100644 --- a/public/js/chrome/navigation.js +++ b/public/js/chrome/navigation.js @@ -187,8 +187,7 @@ $body.bind('mousedown', function (event) { var fromClick = false; var $dropdownLinks = $('.dropdownmenu a, .dropdownmenu .button').mouseup(function (e) { if (e.target.nodeName === 'INPUT') { - e.preventDefault(); - return false; + return; } setTimeout(closedropdown, 0); @@ -212,8 +211,7 @@ var $dropdownLinks = $('.dropdownmenu a, .dropdownmenu .button').mouseup(functio $(this).addClass('hover'); }).mousedown(function (e) { if (e.target.nodeName === 'INPUT') { - e.preventDefault(); - return false; + return; } fromClick = true; }); diff --git a/views/index.html b/views/index.html index e7d2fddb..632da58b 100644 --- a/views/index.html +++ b/views/index.html @@ -309,7 +309,7 @@ if(top != self) { JS Bin URLs
{{#if settings.[ui showblog]}} - + All help topics {{else}} Help topics