mirror of https://github.com/rancher/ui.git
31 lines
822 B
JavaScript
31 lines
822 B
JavaScript
import Component from '@ember/component';
|
|
import layout from './template';
|
|
import { inject as service } from '@ember/service'
|
|
|
|
export default Component.extend({
|
|
layout,
|
|
settings: service(),
|
|
tagName: 'div',
|
|
|
|
classNames: ['catalog-box', 'box', 'p-0'],
|
|
classNameBindings: ['active::inactive'],
|
|
|
|
model: null,
|
|
showIcon: true,
|
|
showSource: false,
|
|
showDescription: true,
|
|
active: true,
|
|
srcSet: false,
|
|
|
|
didRender() {
|
|
if (!this.get('srcSet')) {
|
|
this.set('srcSet', true);
|
|
var $icon = this.$('.catalog-icon > img');
|
|
$icon.attr('src', $icon.data('src'));
|
|
this.$('img').on('error', () => {
|
|
$icon.attr('src', `${this.get('app.baseAssets')}assets/images/generic-catalog.svg`);
|
|
});
|
|
}
|
|
}
|
|
});
|