import Component from 'ember-component';

export default Component.extend({
  tagName: 'span',
  gravity: 'w',
  selector: 'a',
  willDestroyElement() {
    this._super(...arguments);
    if (this._teardownTipsySelector) {
      this._teardownTipsySelector.teardownTipsy();
    }
  },
  didInsertElement() {
    this._super(...arguments);
    this._teardownTipsySelector = this.$(this.get('selector')).tipsy({gravity: this.get("gravity")});
  }
});
