Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2022-05-04 11:05:15 +0300
committerGeoSot <geo.sotis@gmail.com>2022-05-04 11:05:15 +0300
commit0bf2b0baa1be397986e13572329996b8f7e5442e (patch)
treedf3a73e636887d469e0ee9292dfd7ed839701703
parent51535cd95ac8eb5746e19c057aeabdbcafef3a8b (diff)
docs: add proper markup on modal's page tooltips ands popoversgs/docs-use-proper-selectors-for-tooltip-popover
-rw-r--r--site/assets/js/application.js17
-rw-r--r--site/content/docs/5.1/components/modal.md8
2 files changed, 6 insertions, 19 deletions
diff --git a/site/assets/js/application.js b/site/assets/js/application.js
index 20d917990e..a099f6c745 100644
--- a/site/assets/js/application.js
+++ b/site/assets/js/application.js
@@ -31,11 +31,9 @@
}
// Tooltip and popover demos
- document.querySelectorAll('.tooltip-demo')
+ document.querySelectorAll('[data-bs-toggle="tooltip"]')
.forEach(tooltip => {
- new bootstrap.Tooltip(tooltip, {
- selector: '[data-bs-toggle="tooltip"]'
- })
+ new bootstrap.Tooltip(tooltip)
})
document.querySelectorAll('[data-bs-toggle="popover"]')
@@ -89,17 +87,6 @@
})
}
- // Demos within modals
- document.querySelectorAll('.tooltip-test')
- .forEach(tooltip => {
- new bootstrap.Tooltip(tooltip)
- })
-
- document.querySelectorAll('.popover-test')
- .forEach(popover => {
- new bootstrap.Popover(popover)
- })
-
// Indeterminate checkbox example
document.querySelectorAll('.bd-example-indeterminate [type="checkbox"]')
.forEach(checkbox => {
diff --git a/site/content/docs/5.1/components/modal.md b/site/content/docs/5.1/components/modal.md
index 2db62d3bb4..762a569bff 100644
--- a/site/content/docs/5.1/components/modal.md
+++ b/site/content/docs/5.1/components/modal.md
@@ -325,10 +325,10 @@ Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal.
</div>
<div class="modal-body">
<h5>Popover in a modal</h5>
- <p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="Popover title" data-bs-content="Popover body content is set in this attribute." data-bs-container="#exampleModalPopovers">button</a> triggers a popover on click.</p>
+ <p>This <a href="#" role="button" class="btn btn-secondary" data-bs-toggle="popover" title="Popover title" data-bs-content="Popover body content is set in this attribute." data-bs-container="#exampleModalPopovers">button</a> triggers a popover on click.</p>
<hr>
<h5>Tooltips in a modal</h5>
- <p><a href="#" class="tooltip-test" title="Tooltip" data-bs-container="#exampleModalPopovers">This link</a> and <a href="#" class="tooltip-test" title="Tooltip" data-bs-container="#exampleModalPopovers">that link</a> have tooltips on hover.</p>
+ <p><a href="#" data-bs-toggle="tooltip" title="Tooltip" data-bs-container="#exampleModalPopovers">This link</a> and <a href="#" data-bs-toggle="tooltip" title="Tooltip" data-bs-container="#exampleModalPopovers">that link</a> have tooltips on hover.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
@@ -347,10 +347,10 @@ Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal.
```html
<div class="modal-body">
<h5>Popover in a modal</h5>
- <p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="Popover title" data-bs-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
+ <p>This <a href="#" role="button" class="btn btn-secondary" data-bs-toggle="popover" title="Popover title" data-bs-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
<hr>
<h5>Tooltips in a modal</h5>
- <p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> have tooltips on hover.</p>
+ <p><a href="#" data-bs-toggle="tooltip" title="Tooltip">This link</a> and <a href="#" data-bs-toggle="tooltip" title="Tooltip">that link</a> have tooltips on hover.</p>
</div>
```