diff options
| author | GeoSot <[email protected]> | 2021-03-16 18:35:03 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-16 18:35:03 +0200 |
| commit | ddf72bc6124618e3f4b6a056503d4f51d49c928e (patch) | |
| tree | f2b6993ddf4709660079f28416eff11db3a1913a /js/src/util | |
| parent | 1e14a0e646d4b27d562f9c6527ff3b97278e5145 (diff) | |
| download | bootstrap-ddf72bc6124618e3f4b6a056503d4f51d49c928e.tar.xz bootstrap-ddf72bc6124618e3f4b6a056503d4f51d49c928e.zip | |
Accept data-bs-body option in the configuration object as well (#33248)
* Accept data-bs-body option in the configuration object as well
Tweak jqueryInterface, add some more tests
* Fix Markdown table formatting and tweak the wording on backdrop
Co-authored-by: Mark Otto <[email protected]>
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/src/util')
| -rw-r--r-- | js/src/util/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js index ae3cd2ac0..e268b0728 100644 --- a/js/src/util/index.js +++ b/js/src/util/index.js @@ -153,6 +153,22 @@ const isVisible = element => { return false } +const isDisabled = element => { + if (!element || element.nodeType !== Node.ELEMENT_NODE) { + return true + } + + if (element.classList.contains('disabled')) { + return true + } + + if (typeof element.disabled !== 'undefined') { + return element.disabled + } + + return element.getAttribute('disabled') !== 'false' +} + const findShadowRoot = element => { if (!document.documentElement.attachShadow) { return null @@ -226,6 +242,7 @@ export { emulateTransitionEnd, typeCheckConfig, isVisible, + isDisabled, findShadowRoot, noop, reflow, |
