|
414 | 414 | /** |
415 | 415 | * Append the header subtitle. |
416 | 416 |
|
417 | | - * @param {jQuery|any} $parent - the parent to append header subtitle to. |
| 417 | + * @param {jQuery|any} $parent - the parent to append the header subtitle to. |
418 | 418 | * @param {Object} options - The toast options. |
419 | 419 | * @private |
420 | 420 | */ |
|
430 | 430 | /** |
431 | 431 | * Append the header close button. |
432 | 432 | * |
433 | | - * @param {jQuery|any} $parent - the parent to append close button to. |
| 433 | + * @param {jQuery|any} $parent - the parent to append the close button to. |
434 | 434 | * @param {Object} options - The toast options. |
435 | 435 | * @private |
436 | 436 | */ |
|
457 | 457 | /** |
458 | 458 | * Append the header title. |
459 | 459 | * |
460 | | - * @param {jQuery|any} $parent - the parent to append header title to. |
| 460 | + * @param {jQuery|any} $parent - the parent to append the header title to. |
461 | 461 | * @param {Object} options - The toast options. |
462 | 462 | * @private |
463 | 463 | */ |
|
515 | 515 | /** |
516 | 516 | * Append the bottom progress bar. |
517 | 517 | * |
518 | | - * @param {jQuery|any} $parent - the parent to append progress bar to. |
| 518 | + * @param {jQuery|any} $parent - the parent to append the progress bar to. |
519 | 519 | * @param {Object} options - The toast options. |
520 | 520 | * @private |
521 | 521 | */ |
|
526 | 526 | const $bar = $('<div/>', { |
527 | 527 | class: `progress-bar overflow-hidden bg-${options.type}`, |
528 | 528 | role: 'progressbar', |
529 | | - 'aria-valuenow': '0', |
530 | 529 | 'aria-valuemin': '0', |
531 | | - 'aria-valuemax': '100' |
| 530 | + 'aria-valuemax': '100', |
| 531 | + 'aria-valuenow': '100' |
532 | 532 | }); |
533 | 533 | const $progress = $('<div/>', { |
534 | 534 | class: 'progress bg-transparent rounded-0', |
|
543 | 543 | /** |
544 | 544 | * Show the toast. |
545 | 545 | * |
546 | | - * @param {jQuery|any} $toast - The toast to show. |
| 546 | + * @param {jQuery<HTMLDivElement>} $toast - The toast to show. |
547 | 547 | * @param {Object} options - The toast options. |
548 | 548 | * @return {Toaster} This instance. |
549 | 549 | * @private |
550 | 550 | */ |
551 | 551 | _showToast: function ($toast, options) { |
552 | | - const that = this; |
553 | 552 | if (options.progress && options.timeout > 200) { |
554 | 553 | const $progress = $toast.find('.progress-bar'); |
555 | 554 | if ($progress.length) { |
556 | 555 | $toast.on('shown.bs.toast', function () { |
557 | | - $progress.css('animation-duration', `${options.timeout}ms`); |
| 556 | + setTimeout(() => { |
| 557 | + $progress.css({ |
| 558 | + transitionDuration: `${options.timeout}ms`, |
| 559 | + width: '100%' |
| 560 | + }); |
| 561 | + }, 10); |
558 | 562 | }); |
559 | 563 | } |
560 | 564 | } |
|
568 | 572 | } |
569 | 573 | }).toast('show'); |
570 | 574 |
|
571 | | - return that; |
| 575 | + return this; |
572 | 576 | }, |
573 | 577 |
|
574 | 578 | /** |
|
0 commit comments