Revert "disable filters by clicking a remove button instead of unchecking them. removed filters will be 'put back' into the add filter select box"

This reverts commit a23059a393459686fead597026601dfeaeeb3421.

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1743 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
j.wollert 14 years ago
parent c9b8e14fb3
commit da20c0e3f9
  1. 5
      app/views/cost_reports/filters/_activate_filter.rhtml
  2. 29
      assets/javascripts/reporting.js
  3. 8
      assets/stylesheets/reporting.css

@ -8,6 +8,7 @@
%>
<td width="<%= element[:width] || 200 %>">
<a href="#" id="rm_<%= element[:filter_name] %>" onclick="removed_filter('<%= element[:filter_name]%>'); return false;" class="icon icon-filterdel"></a>
<label><%= element[:label] %></label>
<input id="cb_<%= element[:filter_name] %>" name="fields[]" onclick="toggle_filter('<%= element[:filter_name] %>');"
type="checkbox" value="<%= element[:filter_name] %>" />
<label for="cb_<%= element[:filter_name] %>"><%= element[:label] %></label>
</td>

@ -1,15 +1,15 @@
/*global $, selectAllOptions, moveOptions */
function toggle_filter(field) {
var remove, to_toggle;
remove = $('rm_' + field);
to_toggle = remove.up().siblings();
if (remove.display) {
to_toggle.invoke('hide');
var check_box, to_toggle;
check_box = $('cb_' + field);
to_toggle = check_box.up().siblings();
if (check_box.checked) {
to_toggle.invoke('show');
}
else {
to_toggle.invoke('show');
to_toggle.invoke('hide');
}
}
@ -62,9 +62,11 @@ function display_category(tr_field) {
}
function show_filter(field) {
var field_el = $('tr_' + field);
var field_el = $('tr_' + field), check_box = null;
if (field_el !== null) {
field_el.show();
check_box = $('cb_' + field);
check_box.checked = true;
toggle_filter(field);
operator_changed(field, $("operators_" + field));
display_category(field_el);
@ -72,9 +74,11 @@ function show_filter(field) {
}
function hide_filter(field) {
var field_el = $('tr_' + field)
var field_el = $('tr_' + field), check_box = null;
if (field_el !== null) {
field_el.hide();
check_box = $('cb_' + field);
check_box.checked = false;
toggle_filter(field);
operator_changed(field, $("operators_" + field));
}
@ -106,13 +110,6 @@ function add_filter(select) {
disable_select_option(select, field);
}
function removed_filter(field) {
var select, field;
select = $("add_filter_select");
hide_filter(field);
enable_select_option(select, field)
}
function show_group_by(group_by, target) {
var source, group_option, i;
source = $("group_by_container");

@ -9,7 +9,7 @@
.report {
text-align: center;
border-collapse: collapse;
border-collapse: collapse;
border: solid 1px #ccc !important;
width: auto !important;
}
@ -135,7 +135,7 @@
.moveLeft {
margin-left: 0px;
margin-right: 0px;
margin-right: 0px;
background-image: url(../images/arrow_D_left.gif);
}
@ -157,7 +157,3 @@
background-image: url(../images/arrow_B_down.gif);
}
.icon-filterdel {
background-image: url(../images/filter_del.png);
}

Loading…
Cancel
Save