Module: check_mk
Branch: master
Commit: ded74d96db78e5c5d9334991172231404b0f0e07
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ded74d96db78e5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun May 6 12:58:05 2012 +0200
Make width of text inputs more precise
---
web/htdocs/htmllib.py | 7 ++++++-
web/htdocs/wato.css | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 2d719f4..7604c72 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -450,8 +450,11 @@ class html:
if default_value == None:
default_value = ""
addprops = ""
+ add_style = ""
if "size" in args:
addprops += " size=%d" % (args["size"] + 1)
+ add_style = "width: %dex; " % args["size"]
+
if "type" in args:
mytype = args["type"]
else:
@@ -459,7 +462,9 @@ class html:
if "autocomplete" in args:
addprops += " autocomplete=\"%s\"" %
args["autocomplete"]
if args.get("style"):
- addprops += " style=\"%s\"" % args["style"]
+ addprops += " style=\"%s%s\"" % (add_style,
args["style"])
+ elif add_style:
+ addprops += " style=\"%s\"" % add_style
value = self.req.vars.get(varname, default_value)
error = self.user_errors.get(varname)
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 156946b..0eae8ea 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -616,7 +616,7 @@ table.validationerror img {
/* Special styling for Timeperiods editor */
.wato table.timeperiod td.name {
- width: 230px;
+ width: 210px;
}
form#form_timeperiod td.vlof_content input.text:first-child {