From b101029f2b65d054a39b0b49c49bac9dca60f181 Mon Sep 17 00:00:00 2001 From: jwollert Date: Fri, 29 Apr 2011 18:39:12 +0200 Subject: [PATCH] fix progressbar interval calculation. SIZE MATTERS --- assets/javascripts/reporting/progressbar.js | 4 ++-- lib/widget/table/progressbar.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/reporting/progressbar.js b/assets/javascripts/reporting/progressbar.js index a33fc45db7..24f3f184bf 100644 --- a/assets/javascripts/reporting/progressbar.js +++ b/assets/javascripts/reporting/progressbar.js @@ -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(); }, diff --git a/lib/widget/table/progressbar.rb b/lib/widget/table/progressbar.rb index ff9bad6ac0..4f73ae4acc 100644 --- a/lib/widget/table/progressbar.rb +++ b/lib/widget/table/progressbar.rb @@ -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)