Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed stacking element bug

  • Loading branch information...
commit bf67fbc204f7858908189b99bf93b5b7b91cbfaf 1 parent 0b82a16
@minddust authored
View
4 CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+### 0.4.5
+
+ * fixed stacking bug on centered text on multiple trigger
+
### 0.4.4
* fixed caching bug with data method
View
6 bootstrap-progressbar.js
@@ -1,5 +1,5 @@
/* ========================================================
- * bootstrap-progressbar v0.4.4
+ * bootstrap-progressbar v0.4.5
* ========================================================
* Copyright 2012 minddust.com
*
@@ -64,6 +64,10 @@
'-moz-border-radius': options.border_radius,
'border-radius': options.border_radius
});
+
+ $parent.find('.progressbar-front-text').remove();
+ $parent.find('.progressbar-back-text').remove();
+
$parent.prepend('<span class="progressbar-back-text" style="position:absolute;width:100%;text-align:center"></span>');
$this.prepend('<span class="progressbar-front-text" style="display:block;text-align:center"></span>');
var $back = $parent.find('.progressbar-back-text'),
View
4 bootstrap-progressbar.min.js
@@ -1,2 +1,2 @@
-/* bootstrap-progressbar v0.4.4 | Copyright 2012 minddust.com | http://www.apache.org/licenses/LICENSE-2.0 */
-(function(b){var e=function(c,d){this.element=b(c);this.options=b.extend({},b.fn.progressbar.defaults,d)};e.prototype={constructor:e,transition:function(){var c=this.element,d=c.parent(),a=this.options,f=c.attr("data-percentage"),e=c.attr("data-amount-part"),i=c.attr("data-amount-total"),n,o,g;n=a.update&&"function"===typeof a.update?a.update:b.fn.progressbar.defaults.update;o=a.done&&"function"===typeof a.done?a.done:b.fn.progressbar.defaults.done;g=a.fail&&"function"===typeof a.fail?a.fail:b.fn.progressbar.defaults.fail;if(a.use_percentage&&!f)g("bootstrap-progressbar: you can't use percentage without data-percentage being set");else{if(!a.use_percentage){if(!e&&!i){g("bootstrap-progressbar: you can't use values without data-amount-part and data-amount-total being set");return}f=Math.round(100*e/i)}if(a.display_text===b.fn.progressbar.display_text.center){d.css("position","relative");c.css({position:"absolute","float":"left",overflow:"hidden","-webkit-border-radius":a.border_radius,"-moz-border-radius":a.border_radius,"border-radius":a.border_radius});d.prepend('<span class="progressbar-back-text" style="position:absolute;width:100%;text-align:center"></span>');c.prepend('<span class="progressbar-front-text" style="display:block;text-align:center"></span>');var p=d.find(".progressbar-back-text"),k=d.find(".progressbar-front-text");k.css("width",d.css("width"));b(window).resize(function(){k.css("width",d.css("width"))})}setTimeout(function(){c.css("width",f+"%");var h,g,l,m,j,q=setInterval(function(){l=c.width();m=d.width();h=Math.round(100*l/m);g=Math.round(l/m*i);h>=f&&(h=f,g=e,o(),clearInterval(q));a.display_text!==b.fn.progressbar.display_text.none&&(j=a.use_percentage?h+"%":g+" / "+i,a.display_text===b.fn.progressbar.display_text.filled?c.text(j):a.display_text===b.fn.progressbar.display_text.center&&(k.text(j),p.text(j)));n(h)},a.refresh_speed)},a.transition_delay)}}};b.fn.progressbar=function(c){return this.each(function(){var d=b(this),a=d.data("progressbar"),f="object"===typeof c&&c;a||d.data("progressbar",a=new e(this,f));if("string"===typeof c)a[c]();a.transition()})};b.fn.progressbar.display_text={none:0,filled:1,center:2};b.fn.progressbar.defaults={transition_delay:300,refresh_speed:50,display_text:b.fn.progressbar.display_text.none,use_percentage:!0,border_radius:"4px",update:b.noop,done:b.noop,fail:b.noop};b.fn.progressbar.Constructor=e})(window.jQuery);
+/* bootstrap-progressbar v0.4.5 | Copyright 2012 minddust.com | http://www.apache.org/licenses/LICENSE-2.0 */
+(function(b){var e=function(c,d){this.element=b(c);this.options=b.extend({},b.fn.progressbar.defaults,d)};e.prototype={constructor:e,transition:function(){var c=this.element,d=c.parent(),a=this.options,f=c.attr("data-percentage"),e=c.attr("data-amount-part"),i=c.attr("data-amount-total"),n,o,g;n=a.update&&"function"===typeof a.update?a.update:b.fn.progressbar.defaults.update;o=a.done&&"function"===typeof a.done?a.done:b.fn.progressbar.defaults.done;g=a.fail&&"function"===typeof a.fail?a.fail:b.fn.progressbar.defaults.fail;if(a.use_percentage&&!f)g("bootstrap-progressbar: you can't use percentage without data-percentage being set");else{if(!a.use_percentage){if(!e&&!i){g("bootstrap-progressbar: you can't use values without data-amount-part and data-amount-total being set");return}f=Math.round(100*e/i)}if(a.display_text===b.fn.progressbar.display_text.center){d.css("position","relative");c.css({position:"absolute","float":"left",overflow:"hidden","-webkit-border-radius":a.border_radius,"-moz-border-radius":a.border_radius,"border-radius":a.border_radius});d.find(".progressbar-front-text").remove();d.find(".progressbar-back-text").remove();d.prepend('<span class="progressbar-back-text" style="position:absolute;width:100%;text-align:center"></span>');c.prepend('<span class="progressbar-front-text" style="display:block;text-align:center"></span>');var p=d.find(".progressbar-back-text"),k=d.find(".progressbar-front-text");k.css("width",d.css("width"));b(window).resize(function(){k.css("width",d.css("width"))})}setTimeout(function(){c.css("width",f+"%");var h,g,l,m,j,q=setInterval(function(){l=c.width();m=d.width();h=Math.round(100*l/m);g=Math.round(l/m*i);h>=f&&(h=f,g=e,o(),clearInterval(q));a.display_text!==b.fn.progressbar.display_text.none&&(j=a.use_percentage?h+"%":g+" / "+i,a.display_text===b.fn.progressbar.display_text.filled?c.text(j):a.display_text===b.fn.progressbar.display_text.center&&(k.text(j),p.text(j)));n(h)},a.refresh_speed)},a.transition_delay)}}};b.fn.progressbar=function(c){return this.each(function(){var d=b(this),a=d.data("progressbar"),f="object"===typeof c&&c;a||d.data("progressbar",a=new e(this,f));if("string"===typeof c)a[c]();a.transition()})};b.fn.progressbar.display_text={none:0,filled:1,center:2};b.fn.progressbar.defaults={transition_delay:300,refresh_speed:50,display_text:b.fn.progressbar.display_text.none,use_percentage:!0,border_radius:"4px",update:b.noop,done:b.noop,fail:b.noop};b.fn.progressbar.Constructor=e})(window.jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.