John Cowen ae71d6ce96
ui: Custom version of ember-block-slots compatible with ember 3 (#5245)
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.
2019-01-30 10:56:04 +00:00

21 lines
607 B
JavaScript

import { computed, get } from '@ember/object';
import Component from '@ember/component';
import layout from '../templates/components/yield-slot';
import Slots from '../mixins/slots';
const YieldSlotComponent = Component.extend({
layout,
tagName: '',
_parentView: computed(function() {
return this.nearestOfType(Slots);
}),
isActive: computed('_parentView._slots.[]', '_name', function() {
return get(this, '_parentView._slots').includes(get(this, '_name'));
}),
});
YieldSlotComponent.reopenClass({
positionalParams: ['_name', '_blockParams'],
});
export default YieldSlotComponent;