1
0

Правка фронта

This commit is contained in:
2026-01-14 08:22:01 +07:00
parent 7eb50ed503
commit 04e88cb7fa
5 changed files with 108 additions and 200 deletions

View File

@@ -67,11 +67,28 @@ const props = defineProps({
const emit = defineEmits(['close', 'update:show'])
const STORAGE_KEY = 'taskboard_panel_width'
const panelRef = ref(null)
const panelWidth = ref(props.width)
const panelWidth = ref(getSavedWidth())
const isResizing = ref(false)
const overlayMouseDownTarget = ref(false)
// Получить сохранённую ширину из localStorage
function getSavedWidth() {
const saved = localStorage.getItem(STORAGE_KEY)
if (saved) {
const width = parseInt(saved, 10)
if (!isNaN(width)) return width
}
return props.width
}
// Сохранить ширину в localStorage
function saveWidth(width) {
localStorage.setItem(STORAGE_KEY, String(width))
}
// Resize логика
const startResize = (e) => {
if (!props.resizable) return
@@ -89,6 +106,9 @@ const onResize = (e) => {
}
const stopResize = () => {
// Сохраняем ширину в localStorage
saveWidth(panelWidth.value)
setTimeout(() => {
isResizing.value = false
}, 100)
@@ -122,10 +142,10 @@ const refreshIcons = () => {
}
}
// Сброс ширины при открытии
// Восстановление ширины при открытии (из localStorage или дефолтная)
watch(() => props.show, (newVal) => {
if (newVal) {
panelWidth.value = props.width
panelWidth.value = getSavedWidth()
}
})