From 8de3cb33ea172fcc53ae3ce1d38e9d3964240e08 Mon Sep 17 00:00:00 2001 From: jwollert Date: Thu, 14 Apr 2011 12:27:53 +0200 Subject: [PATCH] simplify progressbar width calculations --- assets/javascripts/reporting/prototype_progress_bar.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/reporting/prototype_progress_bar.js b/assets/javascripts/reporting/prototype_progress_bar.js index 62bbce8eed..733d890850 100644 --- a/assets/javascripts/reporting/prototype_progress_bar.js +++ b/assets/javascripts/reporting/prototype_progress_bar.js @@ -23,9 +23,7 @@ Control.ProgressBar = Class.create({ this.active = false; this.poller = false; this.container = $(container); - this.containerWidth = this.container.getDimensions().width - - (parseInt(this.container.getStyle('border-right-width').replace(/px/, ''), 10) + - parseInt(this.container.getStyle('border-left-width').replace(/px/, ''), 10)); + this.containerWidth = this.container.getDimensions().width; this.progressContainer = $(document.createElement('div')); this.progressContainer.setStyle({ width: this.containerWidth + 'px', @@ -100,7 +98,7 @@ Control.ProgressBar = Class.create({ }, draw: function () { this.progressContainer.setStyle({ - width: (this.containerWidth - Math.floor((parseInt(this.progress, 10) / 100) * this.containerWidth)) + 'px' + width: (100 - this.progress) + "%" }); }, notify: function (event_name) {