리펙토링: 전체 구조 검토, 개선
This commit is contained in:
@@ -25,6 +25,7 @@ const inputDigits = document.getElementById('input-digits');
|
||||
const previewName = document.getElementById('preview-name');
|
||||
const dirPath = document.getElementById('dir-path');
|
||||
const rubberBand = document.getElementById('rubber-band');
|
||||
const grid = document.getElementById('grid');
|
||||
const gridContainer = document.getElementById('grid-container');
|
||||
const dragGhostEl = document.getElementById('drag-ghost');
|
||||
const thumbSizeHint = document.getElementById('thumb-size-hint');
|
||||
@@ -34,9 +35,11 @@ const btnRedo = document.getElementById('btn-redo');
|
||||
const fileExplorerContainer = document.querySelector('.file-explorer');
|
||||
|
||||
// ── 핸들러 초기화 ─────────────────────────────────
|
||||
history.setOnUpdate(updateHistoryButtons);
|
||||
|
||||
const callbacks = {
|
||||
refreshCardSelection, updateSelCount, updateNumberBadges, updateNewNameLabels,
|
||||
pushHistory: (affectedPaths) => { history.push(state.files, affectedPaths); updateHistoryButtons(); },
|
||||
pushHistory: (affectedPaths) => history.push(state.files, affectedPaths),
|
||||
};
|
||||
|
||||
pinchZoom.init({ gridContainer, thumbSizeHint });
|
||||
@@ -143,7 +146,6 @@ async function loadFolder(folder) {
|
||||
btnRename.disabled = false;
|
||||
history.reset();
|
||||
history.push(state.files);
|
||||
updateHistoryButtons();
|
||||
}
|
||||
|
||||
// ── 정렬 ─────────────────────────────────────────
|
||||
@@ -157,7 +159,6 @@ async function sortFiles(mode) {
|
||||
await renderGrid();
|
||||
setStatus(`${mode === 'name' ? '이름순' : '날짜순'}으로 정렬됨`, true);
|
||||
history.push(state.files);
|
||||
updateHistoryButtons();
|
||||
}
|
||||
|
||||
function updateSortButtons() {
|
||||
|
||||
Reference in New Issue
Block a user