Reworking remove buttons of filters using hidden field for data storage and siemens styles for layout.

pull/6827/head
Wieland Lindenthal 14 years ago
parent fae6123a63
commit eff4e74887
  1. BIN
      assets/images/close.gif
  2. 2
      assets/javascripts/reporting/filters.js
  3. 22
      assets/stylesheets/reporting.css
  4. 6
      lib/widget/filters/remove_button.rb

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

@ -185,7 +185,7 @@ Reporting.Filters = {
$('operators[' + dependents.first() + ']').value = 'any'; $('operators[' + dependents.first() + ']').value = 'any';
Reporting.Filters.operator_changed(dependents.first(), $('operators[' + dependents.first() + ']')); Reporting.Filters.operator_changed(dependents.first(), $('operators[' + dependents.first() + ']'));
// Hide remove box of dependent // Hide remove box of dependent
$('rm_' + dependents.first()).hide(); $('rm_box_' + dependents.first()).hide();
$('tr_' + dependents.first()).addClassName("no-border"); $('tr_' + dependents.first()).addClassName("no-border");
// Remove border of dependent, so it "merges" with the filter before // Remove border of dependent, so it "merges" with the filter before
active_filters.unshift(dependents.first()); active_filters.unshift(dependents.first());

@ -169,20 +169,33 @@
margin-right: 0px; margin-right: 0px;
background-image: url(../images/arrow_B_down.gif); background-image: url(../images/arrow_B_down.gif);
} }
.remove-box {
height: 20px;
width: 20px;
background: white;
float: right;
padding: 1px 0 0 0;
display: block;
margin-top: -5px;
margin-right: -2px;
}
.filter_rem { .filter_rem {
color: transparent; color: transparent;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
background: no-repeat center center transparent; background: no-repeat center center transparent;
height: 16px; height: 18px;
width: 16px; width: 18px;
border-style: none; border-style: none;
display: block;
margin: 0 0 0 2px;
} }
.icon-filter-rem { .icon-filter-rem {
background-image: url(../images/remove.png); background-image: url(../images/close.gif);
position: relative; position: relative;
float:right;
} }
.filter { .filter {
@ -214,8 +227,7 @@ fieldset#filter-settings table td {
border-color: white; border-color: white;
border-style: solid; border-style: solid;
border-width: 2px 0px 0px; border-width: 2px 0px 0px;
padding: 2px; padding: 5px 2px 5px 2px;
vertical-align: middle;
} }
fieldset#filter-settings table .no-border td { fieldset#filter-settings table .no-border td {

@ -1,9 +1,11 @@
class Widget::Filters::RemoveButton < Widget::Filters::Base class Widget::Filters::RemoveButton < Widget::Filters::Base
def render def render
content_tag :td, :width => "25px" do content_tag :td, :width => "25px" do
tag :input, :id => "rm_#{filter_class.underscore_name}", hidden_field = tag :input, :id => "rm_#{filter_class.underscore_name}",
:name => "fields[]", :type => "button", :value => "", :name => "fields[]", :type => "hidden", :value => ""
button = tag :input, :type => "button", :value => "",
:class => "icon filter_rem icon-filter-rem" :class => "icon filter_rem icon-filter-rem"
content_tag(:div, hidden_field + button, :id => "rm_box_#{filter_class.underscore_name}", :class => "remove-box")
end end
end end
end end

Loading…
Cancel
Save