Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Fix for search widget keyup event handling. ESC will close the widget window and RIGHT will load additional search results, especially when the scroll event won't work because of too litte results.

apfelmaennchen2bb0c9b50331
diff --git a/htroot/yacy/ui/js/yacyui-portalsearch.js b/htroot/yacy/ui/js/yacyui-portalsearch.js
index f5eef3246..850a68594 100644
--- a/htroot/yacy/ui/js/yacyui-portalsearch.js
+++ b/htroot/yacy/ui/js/yacyui-portalsearch.js
@@ -167,20 +167,18 @@ function yrun() {
}
});
- $('#ysearch').keyup(function(e) {
- if(ycurr == $("#yquery").getValue()) {
- return false;
- }
+ $('#ysearch').keyup(function(e) {
+
if(e.which == 27) { // ESC
$("#ypopup").dialog('close');
- } else if(e.which == 34) { // PageDown
+ } else if(e.which == 39) { // Right
startRecord = startRecord + maximumRecords;
- } else if(e.which == 33) { // PageUp
- startRecord = startRecord - maximumRecords;
- if(startRecord < 0) startRecord = 0;
- } else {
- startRecord = 0;
+ yacysearch(submit, false);
}
+ if(ycurr == $("#yquery").getValue()) {
+ return false;
+ }
+
if ($("#yquery").getValue() == '') {
if($("#ypopup").dialog('isOpen'))
$("#ypopup").dialog('close');