From ec8d6e93ea8ce64691fb820ef276df4aa22bd369 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 21 Dec 2014 16:43:00 -0600 Subject: [PATCH] Fixing issue 78 --- .../src/IDF/templates/idf/issues/search.html | 3 +- indefero/src/IDF/templates/idf/main-menu.html | 36 +------------------ indefero/www/media/idf/js/projectsearch.js | 32 +++++++++++++++++ 3 files changed, 35 insertions(+), 36 deletions(-) create mode 100644 indefero/www/media/idf/js/projectsearch.js diff --git a/indefero/src/IDF/templates/idf/issues/search.html b/indefero/src/IDF/templates/idf/issues/search.html index 4ffce24..7a4067d 100644 --- a/indefero/src/IDF/templates/idf/issues/search.html +++ b/indefero/src/IDF/templates/idf/issues/search.html @@ -7,6 +7,7 @@

+ {trans 'New Issue'}

{/if} {/block} + {block context} {aurl 'open_url', 'IDF_Views_Issue::searchStatus', array($project.shortname, 'open'), array('q' => $query)} {aurl 'closed_url', 'IDF_Views_Issue::searchStatus', array($project.shortname, 'closed'), array('q' => $query)} @@ -17,7 +18,7 @@ {blocktrans}

Found open issues: {$open}

Found closed issues: {$closed}

{/blocktrans} -{if $tag !== null} +{if $tag != null} {blocktrans}

Label: {$tag.class}:{$tag.name}

{/blocktrans} {else} diff --git a/indefero/src/IDF/templates/idf/main-menu.html b/indefero/src/IDF/templates/idf/main-menu.html index 3f6a73c..114d8bd 100644 --- a/indefero/src/IDF/templates/idf/main-menu.html +++ b/indefero/src/IDF/templates/idf/main-menu.html @@ -22,40 +22,6 @@ {if $allProjects.count() != 0} - + {/if} diff --git a/indefero/www/media/idf/js/projectsearch.js b/indefero/www/media/idf/js/projectsearch.js new file mode 100644 index 0000000..81387b2 --- /dev/null +++ b/indefero/www/media/idf/js/projectsearch.js @@ -0,0 +1,32 @@ +$(document).ready(function() { + + + $("#prjname").keydown(function(ev) { + if(ev.which === 13) { + window.location.replace($('.projectitem :visible').first().attr("href")); + } + }); + + + $('#prjname').keyup(function(){ + var valThis = $(this).val().toLowerCase(); + if(valThis == ""){ + $('.prjlistclass > li').show(); + } else { + $('.prjlistclass > li').each(function(){ + if ($(this).attr('id') && $(this).attr('id') == "searchkeep") + return true; + var text = $(this).text().toLowerCase(); + (text.indexOf(valThis) >= 0) ? $(this).show() : $(this).hide(); + }); + }; + }); + + + $('#project-list').bind('mouseenter', function(ev) { + $(this).find('ul').show(); + $("#prjname").focus(); + }).bind('mouseleave', function(ev) { + $(this).find('ul').hide(); + }); +}); \ No newline at end of file