]> git.ipfire.org Git - thirdparty/bootstrap.git/commit
Manipulator: Add JSON parse support (#35077)
authorGeoSot <geo.sotis@gmail.com>
Thu, 21 Apr 2022 18:41:43 +0000 (21:41 +0300)
committerGitHub <noreply@github.com>
Thu, 21 Apr 2022 18:41:43 +0000 (21:41 +0300)
commit584600bda36ac13ea325617783216d6c6a331c08
tree053f97d3e8401864aca9c0b8e180a3d2c089b4be
parent01cffa682249965eafa581058dd993853d82b3c4
Manipulator: Add JSON parse support (#35077)

Support parsing JSON from each component's main element using the `data-bs-config` attribute.

The `bs-config` attribute will be reserved and omitted during `getDataAttributes` parsing.

With this commit, every component, will create its config object, using:

* defaults
* data-bs-config
* the rest of data attributes
* configuration object given during instance initialization

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markd.otto@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
16 files changed:
.cspell.json
js/src/dom/manipulator.js
js/src/util/config.js
js/tests/unit/dom/manipulator.spec.js
js/tests/unit/tooltip.spec.js
js/tests/unit/util/config.spec.js
site/content/docs/5.1/components/carousel.md
site/content/docs/5.1/components/collapse.md
site/content/docs/5.1/components/dropdowns.md
site/content/docs/5.1/components/modal.md
site/content/docs/5.1/components/offcanvas.md
site/content/docs/5.1/components/popovers.md
site/content/docs/5.1/components/scrollspy.md
site/content/docs/5.1/components/toasts.md
site/content/docs/5.1/components/tooltips.md
site/layouts/partials/js-data-attributes.md [new file with mode: 0644]