Skip to content

Commit

Permalink
support true/false/'top'/'bottom' for showProgress parameter. No need…
Browse files Browse the repository at this point in the history
… to set the proper className for progress anymore
  • Loading branch information
lubber-de committed Oct 4, 2018
1 parent 7266b63 commit f7bc317
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/definitions/modules/toast.js
Expand Up @@ -77,7 +77,7 @@ $.fn.toast = function(parameters) {
module.bind.events();

if(settings.displayTime > 0) {
module.closeTimer = setTimeout(module.close, settings.displayTime+(settings.showProgress ? 300 : 0));
module.closeTimer = setTimeout(module.close, settings.displayTime+(!!settings.showProgress ? 300 : 0));
}
module.show();
},
Expand Down Expand Up @@ -149,10 +149,13 @@ $.fn.toast = function(parameters) {
$toastBox.addClass('compact');
}
$toast = $toastBox.append($toast);
if(settings.showProgress && settings.displayTime > 0){
if(!!settings.showProgress && settings.displayTime > 0){
$progress
.addClass(settings.class)
.append($progressBar);
if(settings.showProgress === 'top' ){
$progress.removeClass('bottom').addClass('top');
}
if ($progress.hasClass('top')) {
$toast.prepend($progress);
} else {
Expand Down

0 comments on commit f7bc317

Please sign in to comment.