From 87da3bd1c3f714f1e8b30cc11286d4319c278e50 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 20 Feb 2015 04:53:33 +0100 Subject: [PATCH] neopolimatrix search on enter --- nbproject/project.properties | 1 + neopolimatrix/page/default_page/js/default_page.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nbproject/project.properties b/nbproject/project.properties index d37ef95..3d9b81a 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,3 +1,4 @@ +auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true include.path=${php.global.include.path} php.version=PHP_54 source.encoding=UTF-8 diff --git a/neopolimatrix/page/default_page/js/default_page.js b/neopolimatrix/page/default_page/js/default_page.js index 3ba4be3..b205370 100644 --- a/neopolimatrix/page/default_page/js/default_page.js +++ b/neopolimatrix/page/default_page/js/default_page.js @@ -15,7 +15,13 @@ function impressum(){ function search(){ $("#nav_search_btn").click(function(){ $('#contentframe').load('./?page=search¶m='+$('#nav_search').val()); - }); + }); + $(document).keypress(function(e) { + var hasFocus = $('#nav_search').is(':focus'); + if(e.which === 13 && hasFocus) { + $('#contentframe').load('./?page=search¶m='+$('#nav_search').val()); + } +}); } function tabs(){