8483f0c27c
The original version of ember-block-slots doesn't support ember 3 and it seems like development has stalled on the original version. This adds a modified version as an in-repo-addon that is compatible with ember 3.
18 lines
431 B
JavaScript
18 lines
431 B
JavaScript
import { computed, get } from '@ember/object';
|
|
import { A } from '@ember/array';
|
|
import Mixin from '@ember/object/mixin';
|
|
export default Mixin.create({
|
|
_slots: computed(function() {
|
|
return A();
|
|
}),
|
|
_activateSlot(name) {
|
|
get(this, '_slots').addObject(name);
|
|
},
|
|
_deactivateSlot(name) {
|
|
get(this, '_slots').removeObject(name);
|
|
},
|
|
_isRegistered(name) {
|
|
return get(this, '_slots').includes(name);
|
|
},
|
|
});
|