Last active
March 2, 2018 21:05
-
-
Save nicksteffens/644ede9c9bb05f2a123a4b91e1f8f6d2 to your computer and use it in GitHub Desktop.
Temporary fix until the https://github.com/sir-dunxalot/ember-tooltips/pull/234 gets in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmberTooltipComponent from 'ember-tooltips/components/ember-tooltip'; | |
import { run } from '@ember/runloop'; | |
import $ from 'jquery'; | |
export default EmberTooltipComponent.extend({ | |
_hideTooltip() { | |
const _tooltip = this.get('_tooltip'); | |
if (!_tooltip || this.get('isDestroying')) { | |
return; | |
} | |
// NOTE: | |
// This must remove listener to not compete with modal-dialogs event listener | |
// SEE: https://github.com/sir-dunxalot/ember-tooltips/pull/234ß | |
if (_tooltip.popperInstance) { | |
_tooltip.popperInstance.popper.classList.remove(ANIMATION_CLASS); | |
} | |
run.later(() => { | |
if (this.get('isDestroying')) { | |
return; | |
} | |
_tooltip.hide(); | |
this.set('_isHiding', false); | |
this.set('isShown', false); | |
this.sendAction('onHide', this); | |
}, this.get('_animationDuration')); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment