From 31ab09bbcef72014011b491972755d5e2c52916e Mon Sep 17 00:00:00 2001 From: kohsah Date: Thu, 26 Oct 2017 13:03:17 +0530 Subject: [PATCH] Fixes for autocomplete search --- .../resources/css-custom/app-custom.css | 19 +++++++++++++++++++ themes/design1/resources/js/searchac.js | 11 ++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/themes/design1/resources/css-custom/app-custom.css b/themes/design1/resources/css-custom/app-custom.css index c3dfaf1..847909c 100644 --- a/themes/design1/resources/css-custom/app-custom.css +++ b/themes/design1/resources/css-custom/app-custom.css @@ -165,4 +165,23 @@ { border: none !important; background-color: red; +} + +/* +.ui-state-focus, .ui-state-hover .ui-state-highlight +{ + color:White; + background:#96B202 !important; + outline:none; +} +*/ + +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + color:White; + background: rgb(250, 244, 244) !important; } \ No newline at end of file diff --git a/themes/design1/resources/js/searchac.js b/themes/design1/resources/js/searchac.js index 5daa9f3..2cb0f42 100644 --- a/themes/design1/resources/js/searchac.js +++ b/themes/design1/resources/js/searchac.js @@ -43,6 +43,7 @@ $(function () { $("#search").catcomplete({ 'minLength':3, + autoFocus: true, 'source': function(request, response) { $.ajax({ url: '/gw/service/searchac/', @@ -58,7 +59,7 @@ $(function () { }, 'select': function(event, ui) { - location.href = 'document.html?iri=' + ui.item.exprAbstract['expr-iri'] + location.href = 'document.html?iri=' + ui.item.exprAbstract['expr-iri']; return false; } }) @@ -88,5 +89,13 @@ $(function () { .append(resultRow.join('')) .appendTo(ul); }; + // check for invalid enter key press + $("#search").keydown(function(event){ + if(event.keyCode == 13) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + }); }); \ No newline at end of file