import { computed } from '@ember/object'; import Component from '@ember/component'; export default Component.extend({ isShowToggle : false, isShowToggleIcon : false, toggleButtonShowAll : false, prevToggleButtonShowAll: false, toggleButtonShowItem : false, prevToggleButtonShowItem: false, toggleState: computed('toggleButtonShowAll', 'toggleButtonShowItem', function() { if (this.prevToggleButtonShowAll != this.toggleButtonShowAll) { this.set("prevToggleButtonShowAll", this.toggleButtonShowAll); this.set("toggleButtonShowItem", this.toggleButtonShowAll); } if (this.toggleButtonShowAll || this.toggleButtonShowItem) { if (this.toggleButtonShowItem) { return true; } return false; } return false; }), title : "", id : "", init() { this._super(...arguments); if (this.toggleButtonShowAll == undefined) { this.set("toggleButtonShowAll", false); } if (this.toggleButtonShowItem == undefined) { this.set("toggleButtonShowItem", false); } }, actions : { toggleCard() { if (this.toggleButtonShowItem) { this.set("toggleButtonShowItem", false); } else { this.set("toggleButtonShowItem", true); } } } });