From 601435c7b87a4243eabd96fb2eceb020951fbe72 Mon Sep 17 00:00:00 2001 From: Zoltan Hawryluk Date: Tue, 3 Jan 2012 17:18:29 -0500 Subject: [PATCH 1/2] A fix to a *small* bug that appears when a border is applied to the progress bar. If the value of the progress bar is set to zero, the progress bar increases in width slightly, until the value is changed to a non-zero value. Fixed by changing offsetWidth to clientWidth. --- progress-polyfill.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/progress-polyfill.js b/progress-polyfill.js index 9cbb97b..40691bd 100644 --- a/progress-polyfill.js +++ b/progress-polyfill.js @@ -156,9 +156,8 @@ var self = window.ProgressPolyfill = { progress.removeAttribute('aria-valuenow'); } } - if(progress.position !== -1) { - progress.style.paddingRight = progress.offsetWidth * (1-progress.position) + 'px'; + progress.style.paddingRight = progress.clientWidth * (1-progress.position) + 'px'; } }, From 720c76a80f4826adc05d2788247131128058fe23 Mon Sep 17 00:00:00 2001 From: Zoltan Hawryluk Date: Wed, 4 Jan 2012 09:58:45 -0500 Subject: [PATCH 2/2] Removed minified version. --- progress-polyfill.min.js | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 progress-polyfill.min.js diff --git a/progress-polyfill.min.js b/progress-polyfill.min.js deleted file mode 100644 index 7867919..0000000 --- a/progress-polyfill.min.js +++ /dev/null @@ -1,5 +0,0 @@ -(function(){if(!("position"in document.createElement("progress"))){var h;h=Object.defineProperty?function(a,c,b){b.enumerable=!0;b.configurable=!0;try{Object.defineProperty(a,c,b)}catch(e){if(e.number===-2146823252)b.enumerable=!1,Object.defineProperty(a,c,b)}}:"__defineSetter__"in document.body?function(a,b,d){a.__defineGetter__(b,d.get);d.set&&a.__defineSetter__(b,d.set)}:function(a,b,d){a[b]=d.get.call(a)};try{[].slice.apply(document.images);var i=function(a){return[].slice.apply(a)}}catch(j){i= -function(a){for(var b=[],d=a.length,e=0;e=0;g--)b.init(b.progresses[g]);document.addEventListener&&(document.addEventListener("DOMAttrModified",function(a){var c=a.target,a=a.attrName;c.nodeName==="PROGRESS"&&(a==="max"||a==="value")&&b.redraw(c)},!1),document.addEventListener("DOMNodeInserted",function(a){a=a.target;a.nodeName==="PROGRESS"&&b.init(a)},!1))}})(); \ No newline at end of file