style: auto-fix linting issues
This commit is contained in:
parent
44d92b46dc
commit
ef142f2ff0
2 changed files with 7 additions and 8 deletions
|
|
@ -17,7 +17,7 @@ export class SidePanelManager {
|
||||||
|
|
||||||
initResizer() {
|
initResizer() {
|
||||||
this.resizerElement.addEventListener('mousedown', this.startResize.bind(this));
|
this.resizerElement.addEventListener('mousedown', this.startResize.bind(this));
|
||||||
|
|
||||||
// Restore saved width if available
|
// Restore saved width if available
|
||||||
const savedWidth = localStorage.getItem('side-panel-width');
|
const savedWidth = localStorage.getItem('side-panel-width');
|
||||||
if (savedWidth) {
|
if (savedWidth) {
|
||||||
|
|
@ -30,10 +30,10 @@ export class SidePanelManager {
|
||||||
this.isResizing = true;
|
this.isResizing = true;
|
||||||
this.panel.style.transition = 'none'; // Disable transition for smooth resizing
|
this.panel.style.transition = 'none'; // Disable transition for smooth resizing
|
||||||
document.body.style.cursor = 'ew-resize';
|
document.body.style.cursor = 'ew-resize';
|
||||||
|
|
||||||
this.resizeBind = this.resize.bind(this);
|
this.resizeBind = this.resize.bind(this);
|
||||||
this.stopResizeBind = this.stopResize.bind(this);
|
this.stopResizeBind = this.stopResize.bind(this);
|
||||||
|
|
||||||
document.addEventListener('mousemove', this.resizeBind);
|
document.addEventListener('mousemove', this.resizeBind);
|
||||||
document.addEventListener('mouseup', this.stopResizeBind);
|
document.addEventListener('mouseup', this.stopResizeBind);
|
||||||
}
|
}
|
||||||
|
|
@ -44,10 +44,10 @@ export class SidePanelManager {
|
||||||
const minWidth = 300;
|
const minWidth = 300;
|
||||||
const maxWidth = window.innerWidth * 0.9;
|
const maxWidth = window.innerWidth * 0.9;
|
||||||
let newWidth = window.innerWidth - e.clientX;
|
let newWidth = window.innerWidth - e.clientX;
|
||||||
|
|
||||||
if (newWidth < minWidth) newWidth = minWidth;
|
if (newWidth < minWidth) newWidth = minWidth;
|
||||||
if (newWidth > maxWidth) newWidth = maxWidth;
|
if (newWidth > maxWidth) newWidth = maxWidth;
|
||||||
|
|
||||||
this.panel.style.setProperty('--side-panel-width', `${newWidth}px`);
|
this.panel.style.setProperty('--side-panel-width', `${newWidth}px`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,10 +55,10 @@ export class SidePanelManager {
|
||||||
this.isResizing = false;
|
this.isResizing = false;
|
||||||
this.panel.style.transition = ''; // Restore transitions
|
this.panel.style.transition = ''; // Restore transitions
|
||||||
document.body.style.cursor = '';
|
document.body.style.cursor = '';
|
||||||
|
|
||||||
document.removeEventListener('mousemove', this.resizeBind);
|
document.removeEventListener('mousemove', this.resizeBind);
|
||||||
document.removeEventListener('mouseup', this.stopResizeBind);
|
document.removeEventListener('mouseup', this.stopResizeBind);
|
||||||
|
|
||||||
// Save the width
|
// Save the width
|
||||||
const currentWidth = this.panel.style.getPropertyValue('--side-panel-width').replace('px', '');
|
const currentWidth = this.panel.style.getPropertyValue('--side-panel-width').replace('px', '');
|
||||||
if (currentWidth) {
|
if (currentWidth) {
|
||||||
|
|
|
||||||
|
|
@ -5263,7 +5263,6 @@ input:checked + .slider::before {
|
||||||
background-color: var(--brand);
|
background-color: var(--brand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.side-panel.active {
|
.side-panel.active {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
box-shadow: var(--shadow-xl);
|
box-shadow: var(--shadow-xl);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue