From 7ea83c2e0bed67646340ec503bc53cc704040678 Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Fri, 3 Jun 2011 16:25:03 +0200 Subject: [PATCH] resurrected filter(chainable) help icons --- lib/widget/filters.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/widget/filters.rb b/lib/widget/filters.rb index b99d82ae9c..88626dcaad 100644 --- a/lib/widget/filters.rb +++ b/lib/widget/filters.rb @@ -18,7 +18,7 @@ class Widget::Filters < Widget::Base :name => nil add_filter += maybe_with_help :icon => { :class => 'filter-icon' }, :tooltip => { :class => 'filter-tip' }, - :instant_write => false + :instant_write => false # help associated with this kind of Widget add_filter.html_safe end write content_tag(:div, table + select) @@ -74,6 +74,21 @@ class Widget::Filters < Widget::Base render_widget Filters::MultiValues, f, :to => html end end + render_filter_help f, :to => html render_widget Filters::RemoveButton, f, :to => html end + + ##Renders help for a filter (chainable) + def render_filter_help(filter, options = {}) + html = content_tag :td, :width => "25px" do + if filter.help_text # help associated with the chainable this Widget represents + render_widget Widget::Controls::Help, filter.help_text + end + end + if canvas = options[:to] + canvas << "\n" << html + else + html + end + end end