aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-04-19 15:08:06 +0200
committerJohann-S <[email protected]>2017-05-14 11:41:19 +0200
commite5a0471b0b618409e30529a5e02933d5a74a4cc5 (patch)
treefb144078e849108c584946f6842d6316e0fd3603 /js/src
parentfc8b85b62670b8396cac7fb821c025c58fa77a78 (diff)
downloadbootstrap-e5a0471b0b618409e30529a5e02933d5a74a4cc5.tar.xz
bootstrap-e5a0471b0b618409e30529a5e02933d5a74a4cc5.zip
Add an update method to allow to update position for Tooltip/Popover/Dropdown manually
Diffstat (limited to 'js/src')
-rw-r--r--js/src/dropdown.js6
-rw-r--r--js/src/tooltip.js12
2 files changed, 16 insertions, 2 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index 613a23812..0c082edd6 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 a8c0ab6f1..d50ddbb3e 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