github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/components/job-page/parts/summary.js (about)

     1  import Component from '@ember/component';
     2  import { computed } from '@ember/object';
     3  
     4  export default Component.extend({
     5    job: null,
     6    classNames: ['boxed-section'],
     7  
     8    isExpanded: computed(function() {
     9      const storageValue = window.localStorage.nomadExpandJobSummary;
    10      return storageValue != null ? JSON.parse(storageValue) : true;
    11    }),
    12  
    13    persist(item, isOpen) {
    14      window.localStorage.nomadExpandJobSummary = isOpen;
    15      this.notifyPropertyChange('isExpanded');
    16    },
    17  });