From 754b31fc917174af0d07cbba3aadf8b39920287b Mon Sep 17 00:00:00 2001 From: jwollert Date: Wed, 25 May 2011 15:26:13 +0200 Subject: [PATCH] use method in progressbar to check whether to render the table directly --- lib/widget/table/progressbar.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/widget/table/progressbar.rb b/lib/widget/table/progressbar.rb index 02d344ff5a..50335a3fd1 100644 --- a/lib/widget/table/progressbar.rb +++ b/lib/widget/table/progressbar.rb @@ -2,7 +2,7 @@ class Widget::Table::Progressbar < Widget::Base dont_cache! def render - if Widget::Table::ReportTable.new(@subject).cached? || @subject.size <= THRESHHOLD + if render_table? render_widget Widget::Table::ReportTable, @subject, :to => (@output ||= "".html_safe) else write(content_tag :label, :style => "display:none" do @@ -12,6 +12,10 @@ class Widget::Table::Progressbar < Widget::Base end end + def render_table? + Widget::Table::ReportTable.new(@subject).cached? || @subject.size <= THRESHHOLD + end + def render_progress_bar content_tag(:div, "", :id => "progressbar",