retire transitionend

This commit is contained in:
Leopoldthecoder
2017-01-13 19:52:26 +08:00
parent 813de47354
commit 2dd085b403
3 changed files with 15 additions and 14 deletions

View File

@@ -36,8 +36,7 @@ exports.install = Vue => {
});
} else {
if (el.domVisible) {
const destroyElement = function() {
el.mask.removeEventListener('transitionend', destroyElement);
el.instance.$on('after-leave', _ => {
el.domVisible = false;
if (binding.modifiers.fullscreen && el.originalOverflow !== 'hidden') {
document.body.style.overflow = el.originalOverflow;
@@ -47,8 +46,7 @@ exports.install = Vue => {
} else {
el.style.position = el.originalPosition;
}
};
el.mask.addEventListener('transitionend', destroyElement);
});
el.instance.visible = false;
}
}