all files / addon/components/ el-tooltip.js

0% Statements 0/1
100% Branches 0/0
0% Functions 0/2
0% Lines 0/1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135                                                                                                                                                                                                                                                                             
import Component from '@ember/component';
// import {get, set} from '@ember/object';
// import Ember from 'ember';
// import $ from 'jquery';
// import layout from '../templates/components/el-tooltip';
 
// todo: WIP
 
export default Component.extend({
 
  // layout,
 
  tagName: '',
  openDelay: 0,
  disabled: false,
  manual: false,
  effect: 'dark',
  arrowOffset: 0,
  popperCLass: '',
  content: '',
  visibleArrow: true,
  transition: 'el-fade-in-linear',
  hideAfter: 0,
 
  html: true,
  placement: 'auto',
  title: '',
 
  didInsertElement() {
    this._super(...arguments);
    // let parent = this.getParent(this);
    //
    // set(this, 'parent', parent);
 
  },
 
  didRender(){
    // $(get(this, 'parent')).attr('data-original-title', get(this, 'title'))
    //   .tooltip({
    //     placement: get(this, 'placement'),
    //     html: true
    //   });
 
    // this._updatePopper();
  },
 
 
 
  //
  // _updatePopper() {
  //   if (this.isDestroying || this.isDestroyed) {
  //     return;
  //   }
  //
  //   const eventsEnabled = this.get('eventsEnabled');
  //   const modifiers = this.get('modifiers');
  //   const onCreate = this.get('onCreate');
  //   const onUpdate = this.get('onUpdate');
  //   const placement = this.get('placement');
  //   // const popperTarget = this._getPopperTarget();
  //   const renderInPlace = this.get('_renderInPlace');
  //
  //   // Compare against previous values to see if anything has changed
  //   const didChange = renderInPlace !== this._didRenderInPlace
  //     // || popperTarget !== this._popperTarget
  //     || eventsEnabled !== this._eventsEnabled
  //     || modifiers !== this._modifiers
  //     || placement !== this._placement
  //     || onCreate !== this._onCreate
  //     || onUpdate !== this._onUpdate;
  //
  //   if (didChange === true) {
  //     if (this._popper !== null) {
  //       this._popper.destroy();
  //     }
  //
  //     const popperElement = this._getPopperElement();
  //
  //     // Store current values to check against on updates
  //     this._didRenderInPlace = renderInPlace;
  //     this._eventsEnabled = eventsEnabled;
  //     this._modifiers = modifiers;
  //     this._onCreate = onCreate;
  //     this._onUpdate = onUpdate;
  //     this._placement = placement;
  //     // this._popperTarget = popperTarget;
  //
  //     const options = {
  //       eventsEnabled,
  //       modifiers,
  //       placement
  //     };
  //
  //     if (onCreate) {
  //       assert('onCreate of ember-popper must be a function', typeof onCreate === 'function');
  //       options.onCreate = onCreate;
  //     }
  //
  //     if (onUpdate) {
  //       assert('onUpdate of ember-popper must be a function', typeof onUpdate === 'function');
  //       options.onUpdate = onUpdate;
  //     }
  //
  //     this._popper = new Popper(popperTarget, popperElement, options);
  //
  //     // Execute the registerAPI hook last to ensure the Popper is initialized on the target
  //     if (this.get('registerAPI') !== null) {
  //       /* eslint-disable ember/closure-actions */
  //       this.get('registerAPI')(this._getPublicAPI());
  //     }
  //   }
  // },
 
 
  // _getPopperTarget(){
  //   $(get(this, 'parent'));
  // },
  //
  // getParent(view) {
  //   if (get(view, 'tagName') === '') {
  //     // Beware: use of private API! :(
  //     if (Ember.ViewUtils && Ember.ViewUtils.getViewBounds) {
  //       return Ember.ViewUtils.getViewBounds(view).parentElement;
  //     } else {
  //       return view._renderNode.contextualElement;
  //     }
  //   } else {
  //     return get(view, 'element').parentNode;
  //   }
  // }
 
});