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 {
|
2021-10-20 12:40:08 +00:00
|
|
|
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');
|
|
|
|
|
2021-10-20 12:40:08 +00:00
|
|
|
if (!isHidden) {
|
2021-06-15 11:48:42 +00:00
|
|
|
monitor.classList.add('hidden');
|
2021-10-20 12:40:08 +00:00
|
|
|
localStorage.setItem('ticketTopPanelHidden', true);
|
|
|
|
} else {
|
2021-06-15 11:48:42 +00:00
|
|
|
monitor.classList.remove('hidden');
|
2021-10-20 12:40:08 +00:00
|
|
|
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
|
|
|
});
|