salix/modules/monitor/front/index/index.js

35 lines
981 B
JavaScript

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'
}
});