2018-10-19 15:17:02 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import { get } from '@ember/object';
|
|
|
|
import Component from '@ember/component';
|
|
|
|
export default Component.extend({
|
|
|
|
buffer: service('dom-buffer'),
|
|
|
|
getBufferName: function() {
|
|
|
|
// TODO: Right now we are only using this for the modal layer
|
|
|
|
// moving forwards you'll be able to name your buffers
|
|
|
|
return 'modal';
|
|
|
|
},
|
|
|
|
didInsertElement: function() {
|
2019-04-08 10:16:24 +00:00
|
|
|
this._super(...arguments);
|
2018-10-19 15:17:02 +00:00
|
|
|
get(this, 'buffer').add(this.getBufferName(), this.element);
|
|
|
|
},
|
|
|
|
didDestroyElement: function() {
|
2019-04-08 10:16:24 +00:00
|
|
|
this._super(...arguments);
|
2018-10-19 15:17:02 +00:00
|
|
|
get(this, 'buffer').remove(this.getBufferName());
|
|
|
|
},
|
|
|
|
});
|