replacing "remove" background image with image tag

pull/6827/head
Jens Ulferts 13 years ago
parent b9a263e854
commit ee43cde628
  1. 21
      assets/javascripts/reporting/group_bys.js
  2. 2
      assets/stylesheets/reporting.css
  3. 4
      lib/widget/group_bys.rb

@ -40,25 +40,32 @@ Reporting.GroupBys = {
},
create_remove_button: function(group_by) {
var button = new Element('a', {
var remove_link, remove_icon;
remove_link = new Element('a', {
'class': 'group_by_remove in_row',
'id': group_by.identify() + '_remove',
'href': 'javascript:'
});
remove_icon = $('hidden_remove_img').clone();
remove_icon.removeAttribute('id');
remove_icon.removeAttribute('style');
if (Reporting._LA != undefined) {
button.setAttribute('title', Reporting._LA["REMOVE"] + ' ' + group_by.down('label').innerHTML);
remove_link.setAttribute('title', Reporting._LA["REMOVE"] + ' ' + group_by.down('label').innerHTML);
remove_icon.setAttribute('alt', Reporting._LA["REMOVE"] + ' ' + group_by.down('label').innerHTML);
}
button.observe('click', function(e) {
Reporting.GroupBys.remove_element_event_action(e, group_by, button)
remove_link.observe('click', function(e) {
Reporting.GroupBys.remove_element_event_action(e, group_by, remove_link)
});
button.observe('keypress', function(e) {
remove_link.observe('keypress', function(e) {
/* keyCode 32: Space */
if (e.keyCode == 32) {
e.preventDefault();
Reporting.GroupBys.remove_element_event_action(e, group_by, button)
Reporting.GroupBys.remove_element_event_action(e, group_by, remove_link)
}
});
return button;
remove_link.appendChild(remove_icon);
return remove_link;
},
remove_element_event_action: function(event, group_by, button) {

@ -309,8 +309,6 @@ fieldset#filter-settings table td > label {
top: 7px;
right: 21px;
cursor: pointer;
background: no-repeat left center;
background-image: url(../images/remove.gif);
}
.group_by_remove.hover {

@ -59,6 +59,10 @@ class Widget::GroupBys < Widget::Base
write(content_tag :div, :id => 'group_by_area' do
out = render_group 'columns', @subject.group_bys(:column), true
out += render_group 'rows', @subject.group_bys(:row)
out += image_tag "remove.gif",
:plugin => "reporting_engine",
:id => "hidden_remove_img",
:style => "display:none"
out.html_safe
end)
end

Loading…
Cancel
Save