Module: check_mk
Branch: master
Commit: cf95e4dbb7ed7c086aba8e802f6c0bc413ee44ff
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf95e4dbb7ed7c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 12 12:09:54 2016 +0100
4137 FIX List of strings: New fields are now added when last field is not empty
This is a usability fix for users which are tabbing through the GUI. You can
now escape the list of strings extension by simply leaving the last field empty.
Change-Id: I8dd149eabcd56d553b423f36f8906c724113ddab
---
.werks/4137 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/js/checkmk.js | 14 ++++++++++++--
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/.werks/4137 b/.werks/4137
new file mode 100644
index 0000000..90c05f9
--- /dev/null
+++ b/.werks/4137
@@ -0,0 +1,10 @@
+Title: List of strings: New fields are now added when last field is not empty
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i3
+Date: 1481540934
+Class: fix
+
+This is a usability fix for users which are tabbing through the GUI. You can
+now escape the list of strings extension by simply leaving the last field empty.
diff --git a/ChangeLog b/ChangeLog
index 32789a4..473c7b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,7 @@
* 4127 FIX: Fixed possible "maximum recursion depth exceeded" error when
sorting tables with a lot of text in cells
* 4128 FIX: Fixed exception in "Virtual host tree" snapin in case a user
tries to access a not existing tree
* 4129 FIX: Fixed possible exception when a view is linking to a not permitted other
view
+ * 4137 FIX: List of strings: New fields are now added when last field is not
empty...
WATO:
* 3984 Permissions can now be filtered by providing a search term on the "edit
role" page...
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 6d674ba..6547286 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1747,8 +1747,16 @@ function list_of_strings_init(divid) {
function list_of_strings_add_focus(oLastChild) {
/* look for <input> in last child node and attach focus handler to it. */
var input = oLastChild.getElementsByTagName("input");
- if (input.length == 1)
- input[0].onfocus = function(e) { return list_of_strings_extend(this); };
+ if (input.length == 1) {
+ var handler_func = function(e) {
+ if (this.value != "") {
+ return list_of_strings_extend(this);
+ }
+ };
+
+ input[0].onfocus = handler_func;
+ input[0].oninput = handler_func;
+ }
}
/* Is called when the last input field in a ListOfString gets focus.
@@ -1783,6 +1791,8 @@ function list_of_strings_extend(oInput, j) {
/* Move focus function from old last to new last input field */
list_of_strings_add_focus(oNewDiv);
+
+ oInput.oninput = null;
oInput.onfocus = null;
}