fix progressbar interval calculation. SIZE MATTERS

pull/6827/head
jwollert 14 years ago
parent 973b1251b4
commit b101029f2b
  1. 4
      assets/javascripts/reporting/progressbar.js
  2. 2
      lib/widget/table/progressbar.rb

@ -5,11 +5,11 @@ Reporting.Progress = {
replace_with_bar: function (element) {
var parent = element.up();
var size = parseInt(element.getAttribute('data-size'), 10) || 500;
var size = parseInt(element.getAttribute('data-query-size'), 10) || 500;
element.remove();
var bar = Reporting.Progress.add_bar_to_parent(parent);
// Speed determined through laborous experimentation!
bar.interval = (size * (Math.log(size))) / 100000;
bar.options.interval = (size * (Math.log(size))) / 100000;
bar.start();
},

@ -5,7 +5,7 @@ class Widget::Table::Progressbar < Widget::Base
if Widget::Table::ReportTable.new(@query).cached? || @query.size <= THRESHHOLD
render_widget Widget::Table::ReportTable, @query, :to => (@output ||= "".html_safe)
else
write(content_tag :div, :style => "display:none" do
write(content_tag :label, :style => "display:none" do
content_tag(:div, l(:label_progress_bar_explanation).html_safe) +
render_progress_bar
end)

Loading…
Cancel
Save