diff --git a/src/index.css b/src/index.css index b457481..79d943a 100644 --- a/src/index.css +++ b/src/index.css @@ -159,4 +159,8 @@ body { padding: 0.5rem 1rem; font-style: italic; cursor: pointer; +} + +.suggestions-ctn li span:hover { + text-decoration: underline; } \ No newline at end of file diff --git a/src/index.js b/src/index.js index f0da31b..fb1491e 100644 --- a/src/index.js +++ b/src/index.js @@ -153,6 +153,12 @@ function initSearch(){ suggestionsCtn.innerHTML = ''; } } + $('body').onkeydown = function(e){ + if(e.keyCode == 17 || e.keyCode == 91 || e.keyCode == 93){ + //Control or Command + searchInput.focus(); + } + } $('body').onkeypress = function(e){ searchInput.focus(); } @@ -201,20 +207,9 @@ function onSuggestionReceived(r){ suggestionsCtn.innerHTML = suggestionsHtml; $$('.suggestions-ctn li span').forEach(function(v, i){ v.onclick = function(){doSearch(this.innerText)}; - v.onmouseover = function(){searchItemHover(this)}; - v.onmouseout = function(){searchItemMouseout(this)}; }); } } -function searchItemHover(item){ - if(currentSelectSuggestionIndex >= 0 && currentSelectSuggestionIndex < suggestionsCtn.childNodes.length){ - suggestionsCtn.childNodes[currentSelectSuggestionIndex].childNodes[0].classList.remove('clear-box-shadow'); - } - item.classList.add('clear-box-shadow'); -}; -function searchItemMouseout(item){ - item.classList.remove('clear-box-shadow'); -}; function doSearch(keyword){ window.location.href = SearchEngines[Settings.searchEngine].replace('{keyword}', keyword); } diff --git a/src/manifest.json b/src/manifest.json index 583316f..318500e 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "__MSG_pluginName__", "short_name": "__MSG_shortName__", - "version": "1.0.5", + "version": "1.0.6", "description": "__MSG_pluginDesc__", "icons": {