Module: check_mk
Branch: master
Commit: 4edf6e334f60d592dcf94323f7fcb41056152440
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4edf6e334f60d5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 28 12:14:51 2016 +0100
Color() selection: fix styling
---
web/htdocs/check_mk.css | 11 +++++++++--
web/htdocs/htmllib.py | 4 ++--
web/htdocs/valuespec.py | 2 +-
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 03d0bf8..817ee21 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -581,10 +581,17 @@ div#hover_menu div.error {
/* Color picker styling */
+div.popup_trigger.colorpicker div.popup_menu {
+ min-width: auto;
+}
+
.cp-preview {
- width: 20px;
- height: 20px;
+ width: 28px;
+ height: 18px;
border: 1px solid #000;
+ box-shadow: 1px 1px 2px inset;
+ position: relative;
+ top: 2px;
}
.picker-wrapper,
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 75eda4f..6f1c521 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1028,9 +1028,9 @@ class html(GUITester):
else:
self.status_icons[img] = tooltip
- def render_popup_trigger(self, content, ident, what=None, data=None, url_vars=None,
style=None, menu_content=None):
+ def render_popup_trigger(self, content, ident, what=None, data=None, url_vars=None,
style=None, menu_content=None, cssclass=None):
style = style and (' style="%s"' % style) or ""
- src = '<div class="popup_trigger"
id="popup_trigger_%s"%s>\n' % (ident, style)
+ src = '<div class="popup_trigger%s"
id="popup_trigger_%s"%s>\n' % (cssclass and (" " + cssclass) or
"", ident, style)
onclick = 'toggle_popup(event, this, \'%s\', %s, %s, %s, %s)' %
\
(ident, what and "'"+what+"'" or
'null',
data and self.attrencode(json.dumps(data)) or 'null',
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 3e0d7dc..f70ee07 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -3577,7 +3577,7 @@ class Color(ValueSpec):
"}).setHex(\"%s\");</script>" % (varprefix,
varprefix, varprefix,
self._on_change or "", value)
- html.popup_trigger(indicator, varprefix + '_popup',
menu_content=menu_content)
+ html.popup_trigger(indicator, varprefix + '_popup',
menu_content=menu_content, cssclass="colorpicker")