addon/components/ui-popup-content.js

  1. import Component from '@ember/component';
  2. import { scheduleOnce } from '@ember/runloop';
  3.  
  4. import layout from '../templates/components/ui-popup-content';
  5.  
  6. /**
  7.  
  8. ui-popup-content component
  9.  
  10. @module components
  11. @namespace components
  12. @class UiPopupContent
  13. @constructor
  14. */
  15. export default Component.extend({
  16. layout,
  17. classNameBindings: ['_ui', 'class', '_componentClass'],
  18. class: 'flowing',
  19. _ui: 'ui',
  20. _componentClass: 'popup',
  21. /**
  22. target which pop this component
  23. @property {function} target
  24. */
  25. target: null,
  26. init(){
  27. this._super(...arguments);
  28. if(typeof this.attrs.target){
  29. scheduleOnce('afterRender', this, function(){
  30. this.attrs.target.update(this.elementId);
  31. });
  32. }
  33. }
  34. });
  35.