all files / addon/components/polaris-skeleton-page/ action.js

100% Statements 2/2
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                                     
import Component from '@ember/component';
import { computed } from '@ember/object';
import { htmlSafe } from '@ember/string';
import layout from '../../templates/components/polaris-skeleton-page/action';
 
export default Component.extend({
  classNames: ['Polaris-SkeletonPage__Action'],
  attributeBindings: ['style'],
 
  layout,
 
  width: computed(function() {
    return Math.round(Math.random() * 40 + 60);
  }).readOnly(),
 
  style: computed('width', function() {
    return htmlSafe(`width: ${ this.get('width') }px;`);
  }).readOnly(),
});