Module: check_mk
Branch: master
Commit: 597edd500d6ece560ecc16d6a9e6f783d97680e8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=597edd500d6eceā¦
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 3 10:39:49 2013 +0100
FIX: Quicksearch: Fixed Up/Down arrow handling in chrome
---
.bugs/877 | 9 ++++++-
.bugs/883 | 7 ++++-
ChangeLog | 1 +
web/htdocs/js/search.js | 54 +++++++++++-----------------------------------
4 files changed, 26 insertions(+), 45 deletions(-)
diff --git a/.bugs/877 b/.bugs/877
index 0810623..9f3f67a 100644
--- a/.bugs/877
+++ b/.bugs/877
@@ -1,9 +1,14 @@
Title: Quicksearch on Chrome: key down/up does not work
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-11-19 15:29:03
Targetversion: 1.2.0
-Class: bug
Reason is unclear. Down should move the selection field down in order
to select a host without the mouse.
+
+2013-01-03 10:38:58: changed state open -> done
+The event handling was broken for chrome. Simplified the arrow key handling now,
+
+Tested in FF, Chrome, IE.
diff --git a/.bugs/883 b/.bugs/883
index 0c7b394..fcaa153 100644
--- a/.bugs/883
+++ b/.bugs/883
@@ -1,11 +1,14 @@
Title: Handle gracefully missing sidebar snapins
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-12-11 12:45:52
Targetversion: 1.2.0
-Class: bug
If via replication user settings are put onto a remote server
that cannot display all configured sidebar snapins then the
sidebar cannot be displayed. Fix: silently ignore missing
sidebar snapins.
+
+2013-01-03 09:57:48: changed state open -> done
+Has been implemented.
diff --git a/ChangeLog b/ChangeLog
index a19f579..9e3df7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -71,6 +71,7 @@
* FIX: quote HTML variable names, fixes potential JS injection
* Option dials (refresh, number of columns) now turnable by mouse wheel
* FIX: Sidebar not raising exceptions on configured but not available snapins
+ * FIX: Quicksearch: Fixed Up/Down arrow handling in chrome
WATO:
* FIX: Fixed generated manual check definitions for checks without items
diff --git a/web/htdocs/js/search.js b/web/htdocs/js/search.js
index d01ef6a..ef16a73 100644
--- a/web/htdocs/js/search.js
+++ b/web/htdocs/js/search.js
@@ -22,12 +22,6 @@
// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA.
-// +------------------------------------------------------------------+
-// | This file has been contributed and is copyrighted by: |
-// | |
-// | Lars Michelsen <lm(a)mathias-kettner.de> Copyright 2010 |
-// +------------------------------------------------------------------+
-
var aSearchResults = [];
var aSearchContents = '';
var iCurrent = null;
@@ -45,8 +39,6 @@ function mkSearchAddField(field, targetFrame) {
oField.onkeydown = function(e) { if (!e) e = window.event; return
mkSearchKeyDown(e, oField); }
oField.onkeyup = function(e) { if (!e) e = window.event; return
mkSearchKeyUp(e, oField);}
oField.onclick = function(e) { mkSearchClose(); return true; }
- // keypress is needed for key-repeation for cursor up/down
- oField.onkeypress = function(e) { if (!e) e = window.event; return
mkSearchKeyRepeat(e, oField);}
// On doubleclick toggle the list
oField.ondblclick = function(e) { if (!e) e = window.event; mkSearchToggle(e,
oField); }
@@ -70,12 +62,6 @@ function mkSearchKeyUp(e, oField) {
e.cancelBubble = true;
break;
- // Up/Down
- case 38:
- case 40:
- return false;
- break;
-
// Other keys
default:
if (oField.value == "") {
@@ -122,33 +108,6 @@ function mkSearchFindUrl(aSearchObjects, objType, oField) {
return mkSearchGetUrl(objType, namepart, '', found);
}
-function mkSearchKeyRepeat(e, oField) {
- var keyCode = e.which || e.keyCode;
-
- switch (keyCode) {
- // Up arrow
- case 38:
- if(!mkSearchResultShown()) {
- mkSearch(e, oField);
- }
-
- mkSearchMoveElement(-1);
- return false;
- break;
-
- // Down arrow
- case 40:
- if(!mkSearchResultShown()) {
- mkSearch(e, oField);
- }
-
- mkSearchMoveElement(1);
- return false;
- break;
- }
-}
-
-
// On key press down event handler
function mkSearchButton() {
var oField = document.getElementById("mk_side_search_field");
@@ -198,6 +157,19 @@ function mkSearchKeyDown(e, oField) {
}
return;
break;
+
+ // Up/Down arrow (Must not be handled in onkeyup since this does not fire
repeated events)
+ case 38:
+ case 40:
+ if(!mkSearchResultShown()) {
+ mkSearch(e, oField);
+ }
+
+ mkSearchMoveElement(keyCode == 38 ? -1 : 1);
+
+ e.preventDefault();
+ return false;
+ break;
}
oldValue = oField.value;
}