all files / addon/components/ el-aside.js

0% Statements 0/4
0% Branches 0/2
0% Functions 0/1
0% Lines 0/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                                                 
import Component from '@ember/component';
import layout from '../templates/components/el-aside';
import {computed, get} from "@ember/object";
import {htmlSafe} from '@ember/template';
 
export default Component.extend({
  layout,
  tagName: 'aside',
  classNames: ['el-aside', 'el-animate'],
  width: '300px',
  collapse: false,
 
  attributeBindings: ['style'],
 
  style: computed('width', 'collapse', function () {
    let width = get(this, 'width');
    if(get(this, 'collapse') === true){
      width = '65px';
    }
    return htmlSafe('width: ' + width);
  }),
 
});