diff options
| author | Johann-S <[email protected]> | 2017-11-30 10:54:27 +0100 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2018-12-05 16:02:59 +0100 |
| commit | b16127fc105f159ebd06b02df2853941b2aba67c (patch) | |
| tree | 45f5a0138c633e0e3aa6bd5357ffef4d14c8bc6f /js/tests/visual | |
| parent | 850d99bb13b895b83a860c38092755253ceb5b4a (diff) | |
| download | bootstrap-b16127fc105f159ebd06b02df2853941b2aba67c.tar.xz bootstrap-b16127fc105f159ebd06b02df2853941b2aba67c.zip | |
Allow Tooltips/Popovers to work in shadow DOM
Diffstat (limited to 'js/tests/visual')
| -rw-r--r-- | js/tests/visual/tooltip.html | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/js/tests/visual/tooltip.html b/js/tests/visual/tooltip.html index 436f5c1cd..831f26d0a 100644 --- a/js/tests/visual/tooltip.html +++ b/js/tests/visual/tooltip.html @@ -62,7 +62,12 @@ </button> </p> </div> - <div id="target" title="Test tooltip on transformed element"></div> + <div class="row"> + <div class="col-sm-3"> + <div id="target" title="Test tooltip on transformed element"></div> + </div> + <div id="shadow" class="pt-5"></div> + </div> <div id="customContainer"></div> </div> @@ -72,6 +77,21 @@ <script src="../../dist/tooltip.js"></script> <script> $(function () { + if (typeof document.body.attachShadow === 'function') { + var shadowRoot = $('#shadow')[0].attachShadow({ mode: 'open' }) + shadowRoot.innerHTML = + '<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top in a shadow dom">' + + ' Tooltip on top in a shadow dom' + + '</button>' + + '<button id="secondTooltip" type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top in a shadow dom with container option">' + + ' Tooltip on top in a shadow dom' + + '</button>' + + $(shadowRoot.firstChild).tooltip() + $(shadowRoot.getElementById('secondTooltip')).tooltip({ + container: shadowRoot + }) + } $('[data-toggle="tooltip"]').tooltip() $('#tooltipElement').tooltip({ container: $('#customContainer')[0] |
