Tooltip: fix appear in the wrong place

This commit is contained in:
qingwei.li
2016-09-13 21:56:20 +08:00
parent ed79d85379
commit 80fe4ce1f3
5 changed files with 7 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
import PopperJS from 'main/utils/popper';
import { once } from 'wind-dom/src/event';
/**
* @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
* @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
@@ -100,20 +100,13 @@ export default {
doDestroy() {
if (this.showPopper) return;
this.popperJS && this.popperJS.destroy();
this.popperJS.destroy();
this.popperJS = null;
},
destroyPopper() {
if (this.popperJS) {
this.resetTransformOrigin(this.popperJS);
if (this.transition) {
once(this.popperJS._popper, 'webkitTransitionEnd', this.doDestroy);
once(this.popperJS._popper, 'oTransitionend', this.doDestroy);
once(this.popperJS._popper, 'transitionend', this.doDestroy);
} else {
this.doDestroy();
}
}
},