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

35 lines
981 B
JavaScript
Raw Permalink Normal View History

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