diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-04-19 16:08:06 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2017-05-14 12:41:19 +0300 |
commit | e5a0471b0b618409e30529a5e02933d5a74a4cc5 (patch) | |
tree | fb144078e849108c584946f6842d6316e0fd3603 /js | |
parent | fc8b85b62670b8396cac7fb821c025c58fa77a78 (diff) |
Add an update method to allow to update position for Tooltip/Popover/Dropdown manually
Diffstat (limited to 'js')
-rw-r--r-- | js/src/dropdown.js | 6 | ||||
-rw-r--r-- | js/src/tooltip.js | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 613a238128..0c082edd60 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -185,8 +185,14 @@ const Dropdown = (($) => { if (this._popper !== null) { this._popper.destroy() } + this._popper = null } + update() { + if (this._popper !== null) { + this._popper.scheduleUpdate() + } + } // private diff --git a/js/src/tooltip.js b/js/src/tooltip.js index a8c0ab6f1d..d50ddbb3e8 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -227,6 +227,9 @@ const Tooltip = (($) => { this._timeout = null this._hoverState = null this._activeTrigger = null + if (this._popper !== null) { + this._popper.destroy() + } this._popper = null this.element = null @@ -385,6 +388,11 @@ const Tooltip = (($) => { } + update() { + if (this._popper !== null) { + this._popper.scheduleUpdate() + } + } // protected @@ -646,8 +654,8 @@ const Tooltip = (($) => { } _handlePopperPlacementChange(data) { - this._cleanTipClass() - this.addAttachmentClass(this._getAttachment(data.placement)) + this._cleanTipClass() + this.addAttachmentClass(this._getAttachment(data.placement)) } // static |