Module: check_mk
Branch: master
Commit: 935e44f8d4aa4766fe8ba07e551fe230eed979f4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=935e44f8d4aa47…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Sep 24 17:58:16 2018 +0200
CMK-632: Fixed constantly growing input field in Bulk host import
Change-Id: I9fa54d98245576835fa5ba84bd4c6df7b64d3b89
---
cmk/gui/valuespec.py | 2 +-
web/htdocs/js/checkmk.js | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/cmk/gui/valuespec.py b/cmk/gui/valuespec.py
index 5324efe..f816766 100644
--- a/cmk/gui/valuespec.py
+++ b/cmk/gui/valuespec.py
@@ -994,7 +994,7 @@ class TextAreaUnicode(TextUnicode):
if value == None:
value = "" # should never happen, but avoids exception for invalid
input
if self._rows == "auto":
- func = 'valuespec_textarea_resize(this);'
+ func = 'valuespec_textarea_resize(this, %s);' %
json.dumps(html.get_theme())
attrs = { "onkeyup" : func, "onmousedown" : func,
"onmouseup" : func, "onmouseout" : func }
if html.has_var(varprefix):
rows = len(html.var(varprefix).splitlines())
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 108eebf..50cd44e 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -2142,9 +2142,14 @@ function valuespec_cascading_change(oSelect, varprefix, count) {
}
}
-function valuespec_textarea_resize(oArea)
+function valuespec_textarea_resize(oArea, theme)
{
- oArea.style.height = (oArea.scrollHeight - 6) + "px" ;
+ if (theme == "facelift") {
+ delimiter = 16;
+ } else {
+ delimiter = 6;
+ }
+ oArea.style.height = (oArea.scrollHeight - delimiter) + "px";
}
function valuespec_listof_add(varprefix, magic, style)