import ngModule from '../module'; import Section from 'salix/components/section'; import './style.scss'; export default class Controller extends Section { constructor($element, $) { super($element, $); const isTopPanelHidden = localStorage.getItem('ticketTopPanelHidden'); if (isTopPanelHidden === 'true') this.isTopPanelHidden = true; } toggle() { const monitor = this.element.querySelector('vn-horizontal'); const isHidden = monitor.classList.contains('hidden'); if (!isHidden) { monitor.classList.add('hidden'); localStorage.setItem('ticketTopPanelHidden', true); } else { monitor.classList.remove('hidden'); localStorage.setItem('ticketTopPanelHidden', false); } } } ngModule.vnComponent('vnMonitorIndex', { template: require('./index.html'), controller: Controller, require: { main: '^vnMonitorIndex' } });