diff options
| author | Gaƫl Poupard <[email protected]> | 2020-12-03 15:08:31 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-12-04 07:52:03 +0200 |
| commit | 0a141dae94eb9efa301beeb55eed4ebc56e20e44 (patch) | |
| tree | 558c8d7a46a534dd30be0b449675c2293ea31f09 /js/dist/tooltip.js | |
| parent | 53d861c814eab1d00f4420ffd4208f3f9c2849b0 (diff) | |
| download | bootstrap-0a141dae94eb9efa301beeb55eed4ebc56e20e44.tar.xz bootstrap-0a141dae94eb9efa301beeb55eed4ebc56e20e44.zip | |
chore(dist): generate dist files
Diffstat (limited to 'js/dist/tooltip.js')
| -rw-r--r-- | js/dist/tooltip.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index b5e98a650..6e7b9201a 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -156,6 +156,8 @@ } }; + var isRTL = document.documentElement.dir === 'rtl'; + /** * -------------------------------------------------------------------------- * Bootstrap (v5.0.0-alpha3): util/sanitizer.js @@ -368,9 +370,9 @@ var AttachmentMap = { AUTO: 'auto', TOP: 'top', - RIGHT: 'right', + RIGHT: isRTL ? 'left' : 'right', BOTTOM: 'bottom', - LEFT: 'left' + LEFT: isRTL ? 'right' : 'left' }; var Default = { animation: true, @@ -732,6 +734,18 @@ } return title; + }; + + _proto.updateAttachment = function updateAttachment(attachment) { + if (attachment === 'right') { + return 'end'; + } + + if (attachment === 'left') { + return 'start'; + } + + return attachment; } // Private ; @@ -765,7 +779,7 @@ }; _proto._addAttachmentClass = function _addAttachmentClass(attachment) { - this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment); + this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment)); }; _proto._getOffset = function _getOffset() { |
