Module: check_mk
Branch: master
Commit: 5f0346e5d5ff76e06c6e1d8a046ee10ce733de22
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f0346e5d5ff76…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 7 14:19:32 2011 +0200
Changed select group checkbox to button
---
web/htdocs/js/check_mk.js | 13 ++++---------
web/plugins/views/layouts.py | 4 ++--
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index 0b388b0..41ea146 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -1178,7 +1178,7 @@ function toggle_group_rows(checkbox) {
for(var a = group_start; a < group_end; a++)
if(rows[a].tagName === 'TR')
group_rows.push(rows[a]);
- toggle_all_rows(group_rows, !checkbox.checked);
+ toggle_all_rows(group_rows);
group_rows = null;
tbody = null;
@@ -1194,12 +1194,9 @@ function toggle_all_rows(obj, force_status) {
var checkboxes = get_all_checkboxes(obj || document);
var all_selected = true;
- for(var i = 0; i < checkboxes.length && all_selected == true; i++) {
- checkboxes[i].parentNode.backgroundColor = '#000000';
- checkboxes[i].parentNode.parentNode.backgroundColor = '#000000';
+ for(var i = 0; i < checkboxes.length && all_selected == true; i++)
if(g_selected_rows.indexOf(checkboxes[i].name) === -1)
all_selected = false;
- }
// Toggle the state
if((typeof(force_status) !== 'undefined' && force_status) ||
all_selected) {
@@ -1249,11 +1246,9 @@ function get_all_checkboxes(container) {
for(var i = 0; i < container.length; i++) {
var childs = container[i].getElementsByTagName('input');
- for(var a = 0; a < childs.length; a++) {
- if(childs[a].type == 'checkbox' && childs[a].className !=
'group') {
+ for(var a = 0; a < childs.length; a++)
+ if(childs[a].type == 'checkbox')
checkboxes.push(childs[a]);
- }
- }
childs = null;
}
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index f519a5d..4f559ba 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -42,8 +42,8 @@ def render_checkbox_td(view, row, num_tds):
html.write("</td>")
def render_group_checkbox_th():
- html.write("<th><input type=checkbox class=group
name=_toggle_group"
- " onclick=\"toggle_group_rows(this);\"
/></th>")
+ html.write("<th><input type=button class=group
name=_toggle_group"
+ " onclick=\"toggle_group_rows(this);\"
value=\"%s\" /></th>" % _('x'))
# -------------------------------------------------------------------------
# ____ _ _