diff --git a/webroot/js/bootstrap-helper.js b/webroot/js/bootstrap-helper.js index a234ff2..2e42a69 100644 --- a/webroot/js/bootstrap-helper.js +++ b/webroot/js/bootstrap-helper.js @@ -625,6 +625,7 @@ class OverlayFactory { /** * @namespace + * @property {string} text - A small text indicating the reason of the overlay * @property {string=('primary'|'secondary'|'success'|'danger'|'warning'|'info'|'light'|'dark'|'white'|'transparent')} variant - The variant of the overlay * @property {number} opacity - The opacity of the overlay * @property {boolean} rounded - If the overlay should be rounded @@ -634,6 +635,7 @@ class OverlayFactory { * @property {string=('border'|'grow')} spinnerSmall - If the spinner inside the overlay should be small */ static defaultOptions = { + text: '', variant: 'light', opacity: 0.85, blur: '2px', @@ -645,9 +647,10 @@ class OverlayFactory { } static overlayWrapper = '
' - static overlayContainer = '
' + static overlayContainer = '
' static overlayBg = '
' static overlaySpinner = '
' + static overlayText = '' shown = false originalNodeIndex = 0 @@ -667,6 +670,12 @@ class OverlayFactory { if (this.options.spinnerVariant.length > 0) { this.$overlaySpinner.children().addClass(`text-${this.options.spinnerVariant}`) } + if (this.options.text.length > 0) { + this.$overlayText = $(OverlayFactory.overlayText); + this.$overlayText.addClass(`text-${this.options.spinnerVariant}`) + .text(this.options.text) + this.$overlaySpinner.append(this.$overlayText) + } } /** Create the overlay, attach it to the DOM and display it */