Module: check_mk
Branch: master
Commit: 8cbfe20bb12ac150019f260b3ec7e7b04e7e85c5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8cbfe20bb12ac1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jun 11 13:18:48 2014 +0200
Revert "fixed autoresize function of textarea valuespec"
This reverts commit 6f26f98e10deb807c29f6678ba8c21eab41c4304.
---
web/htdocs/js/checkmk.js | 43 ++++---------------------------------------
1 file changed, 4 insertions(+), 39 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 8ce2e7e..213d4e5 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1662,46 +1662,11 @@ function valuespec_cascading_change(oSelect, varprefix, count) {
}
}
-function getEffectiveStyle(e, attr) {
- if(e.style[attr]) {
- // Object local
- return e.style[attr];
- } else if(document.defaultView && document.defaultView.getComputedStyle) {
- // DOM
- return document.defaultView.getComputedStyle(e, null).getPropertyValue(attr);
- } else if(e.currentStyle){
- // IE
- var ie_attr = attr.replace(/\-(\w)/g, function (strMatch, p1){
- return p1.toUpperCase();
- });
- var f = e.currentStyle[ie_attr];
- if(f.length > 0) {
- return f;
- }
- }
- return null;
-}
-
function valuespec_textarea_resize(oArea) {
- var padding_top_txt = getEffectiveStyle(oArea, "padding-top");
- var padding_bottom_txt = getEffectiveStyle(oArea, "padding-bottom");
- var padding_top = 0;
- var padding_bottom = 0;
-
- if (padding_top_txt == null) {
- // Fallback for Firefox and Chrome
- if ((/Firefox./i.test(navigator.userAgent)) ||
(/Chrome/i.test(navigator.userAgent))) {
- padding_top = 3;
- padding_bottom = 3;
- }
- } else {
- if (padding_top_txt.length > 2)
- padding_top = padding_top_txt.substring(0, padding_top_txt.length - 2);
- if (padding_bottom_txt.length > 2)
- padding_bottom = padding_bottom_txt.substring(0, padding_bottom_txt.length -
2);
- }
-
- oArea.style.height = (oArea.scrollHeight - padding_top - padding_bottom) +
"px";
+ oArea.style.height = (oArea.scrollHeight
+ - (/Chrome/i.test(navigator.userAgent) ? 6 : 0)
+ - (/Firefox.29.0/i.test(navigator.userAgent) ? 6 : 0)
+ ) + "px";
}