From 418f17ee2b849dafdc39623ba2378df9229164a7 Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Wed, 22 Jul 2020 22:33:11 +0300 Subject: Add `bs` in data attributes - Add `bs` in data APIs everywhere - Update unit tests --- site/content/docs/5.0/getting-started/javascript.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'site/content/docs/5.0/getting-started/javascript.md') diff --git a/site/content/docs/5.0/getting-started/javascript.md b/site/content/docs/5.0/getting-started/javascript.md index 1b896103b..2235ec67e 100644 --- a/site/content/docs/5.0/getting-started/javascript.md +++ b/site/content/docs/5.0/getting-started/javascript.md @@ -39,7 +39,7 @@ Our dropdowns, popovers and tooltips also depend on [Popper.js](https://popper.j ## Still want to use jQuery? It's possible! -Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. **If Bootstrap detects `jQuery` in the `window` object** it'll add all of our components in jQuery's plugin system; this means you'll be able to do `$('[data-toggle="tooltip"]').tooltip()` to enable tooltips. The same goes for our other components. +Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. **If Bootstrap detects `jQuery` in the `window` object** it'll add all of our components in jQuery's plugin system; this means you'll be able to do `$('[data-bs-toggle="tooltip"]').tooltip()` to enable tooltips. The same goes for our other components. ## Data attributes @@ -71,7 +71,7 @@ myModal.addEventListener('show.bs.modal', function (e) { {{< callout warning >}} ## jQuery events -Bootstrap will detect jQuery if `jQuery` is present in the `window` object and there is no `data-no-jquery` attribute set on ``. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`. +Bootstrap will detect jQuery if `jQuery` is present in the `window` object and there is no `data-bs-no-jquery` attribute set on ``. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`. ```js $('#myTab a').on('shown.bs.tab', function () { @@ -208,8 +208,8 @@ var myDefaultAllowList = bootstrap.Tooltip.Default.allowList // To allow table elements myDefaultAllowList.table = [] -// To allow td elements and data-option attributes on td elements -myDefaultAllowList.td = ['data-option'] +// To allow td elements and data-bs-option attributes on td elements +myDefaultAllowList.td = ['data-bs-option'] // You can push your custom regex to validate your attributes. // Be careful about your regular expressions being too lax -- cgit v1.2.3