Skip to content

Commit

Permalink
[dev-form-helpers] fix data-content and data-html attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
FreexD committed Jan 13, 2021
1 parent 201a967 commit 0a4d4ed
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/js/tabler.js
Expand Up @@ -11,7 +11,7 @@ import './dropdown';
tooltipTriggerList.map(function (tooltipTriggerEl) {
let options = {
delay: {show: 50, hide: 50},
html: true,
html: tooltipTriggerEl.getAttribute("data-bs-html") === "true" ?? false,
placement: tooltipTriggerEl.getAttribute('data-bs-placement') ?? 'auto'
};
return new bootstrap.Tooltip(tooltipTriggerEl, options);
Expand All @@ -23,7 +23,7 @@ import './dropdown';
popoverTriggerList.map(function (popoverTriggerEl) {
let options = {
delay: {show: 50, hide: 50},
html: popoverTriggerEl.getAttribute('data-bs-html') ?? false,
html: popoverTriggerEl.getAttribute('data-bs-html') === "true" ?? false,
placement: popoverTriggerEl.getAttribute('data-bs-placement') ?? 'auto'
};
return new bootstrap.Popover(popoverTriggerEl, options);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_docs/form-helpers.md
Expand Up @@ -10,6 +10,6 @@ menu: docs.components.form-helpers
Use an input helper to display additional information about a form element. The text label will appear once a user hovers over the helper.

{% capture code %}
<span class="form-help" data-bs-toggle="popover" data-bs-placement="top" data-content="<p>ZIP Code must be US or CDN format. You can use an extended ZIP+4 code to determine address more accurately.</p><p class='mb-0'><a href=''>USP ZIP codes lookup tools</a></p>">?</span>
<span class="form-help" data-bs-toggle="popover" data-bs-placement="top" data-bs-html="true" data-bs-content="<p>ZIP Code must be US or CDN format. You can use an extended ZIP+4 code to determine address more accurately.</p><p class='mb-0'><a href=''>USP ZIP codes lookup tools</a></p>">?</span>
{% endcapture %}
{% include example.html code=code %}
2 changes: 1 addition & 1 deletion src/pages/_docs/tooltips.md
Expand Up @@ -32,7 +32,7 @@ Use the default markup to create tooltips that will help users understand partic
If the default tooltip is not enough, you can add the option to use HTML code in the text to highlight particular bits of information and make the content more attractive.

{% capture code %}
<button type="button" class="btn" data-bs-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
<button type="button" class="btn" data-bs-toggle="tooltip" data-bs-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
{% endcapture %}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_includes/forms/form-elements-1.html
Expand Up @@ -60,8 +60,8 @@
</div>
<div class="col-auto align-self-center">
<span class="form-help" data-bs-toggle="popover" data-bs-placement="top"
data-content="<p>ZIP Code must be US or CDN format. You can use an extended ZIP+4 code to determine address more accurately.</p><p class='mb-0'><a href='#'>USP ZIP codes lookup tools</a></p>"
data-html="true">?</span>
data-bs-content="<p>ZIP Code must be US or CDN format. You can use an extended ZIP+4 code to determine address more accurately.</p><p class='mb-0'><a href='#'>USP ZIP codes lookup tools</a></p>"
data-bs-html="true">?</span>
</div>
</div>
</div>

0 comments on commit 0a4d4ed

Please sign in to comment.