use method in progressbar to check whether to render the table directly

pull/6827/head
jwollert 14 years ago
parent ed2dcb99a6
commit 754b31fc91
  1. 6
      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",

Loading…
Cancel
Save