diff options
author | Mark Otto <markdotto@gmail.com> | 2021-06-25 23:41:15 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2021-06-25 23:41:15 +0300 |
commit | 45d26de72817b295c5f94c8426354fd5b7d0a1f9 (patch) | |
tree | 78ef421227b893a2f8c7ea0b45693ccae58e68e4 /js/src/util | |
parent | 088ef6298203255d28c3eb058709cbb501d07c2c (diff) |
Variablize backdrop for modal and offcanvas
Diffstat (limited to 'js/src/util')
-rw-r--r-- | js/src/util/backdrop.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/util/backdrop.js b/js/src/util/backdrop.js index 7ba7b4c43e..fbe32445ea 100644 --- a/js/src/util/backdrop.js +++ b/js/src/util/backdrop.js @@ -9,6 +9,7 @@ import EventHandler from '../dom/event-handler' import { execute, executeAfterTransition, getElement, reflow, typeCheckConfig } from './index' const Default = { + className: 'modal-backdrop', isVisible: true, // if false, we use the backdrop helper without adding any element to the dom isAnimated: false, rootElement: 'body', // give the choice to place backdrop under different elements @@ -16,13 +17,13 @@ const Default = { } const DefaultType = { + className: 'string', isVisible: 'boolean', isAnimated: 'boolean', rootElement: '(element|string)', clickCallback: '(function|null)' } const NAME = 'backdrop' -const CLASS_NAME_BACKDROP = 'modal-backdrop' const CLASS_NAME_FADE = 'fade' const CLASS_NAME_SHOW = 'show' @@ -73,7 +74,7 @@ class Backdrop { _getElement() { if (!this._element) { const backdrop = document.createElement('div') - backdrop.className = CLASS_NAME_BACKDROP + backdrop.className = this._config.className if (this._config.isAnimated) { backdrop.classList.add(CLASS_NAME_FADE) } |