Make modals scroll to top when opened
This commit is contained in:
parent
5a728dbd7c
commit
b61f128745
|
@ -8,7 +8,6 @@ import { addWord, sortWords } from "./wordManagement";
|
||||||
import { migrateDictionary } from './migration';
|
import { migrateDictionary } from './migration';
|
||||||
|
|
||||||
export function updateDictionary () {
|
export function updateDictionary () {
|
||||||
|
|
||||||
renderDictionaryDetails();
|
renderDictionaryDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +48,7 @@ export function openEditModal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('editModal').style.display = '';
|
document.getElementById('editModal').style.display = '';
|
||||||
|
Array.from(document.querySelectorAll('#editModal .modal-content section')).forEach(section => section.scrollTop = 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function saveEditModal() {
|
export function saveEditModal() {
|
||||||
|
|
|
@ -30,6 +30,7 @@ export function openSettingsModal() {
|
||||||
showTemplateEditor(false);
|
showTemplateEditor(false);
|
||||||
|
|
||||||
document.getElementById('settingsModal').style.display = '';
|
document.getElementById('settingsModal').style.display = '';
|
||||||
|
document.querySelector('#settingsModal .modal-content section').scrollTop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateTemplateSelects() {
|
export function updateTemplateSelects() {
|
||||||
|
|
|
@ -35,7 +35,9 @@ function setupEditFormTabs() {
|
||||||
document.getElementById('edit' + t.innerText + 'Tab').style.display = 'none';
|
document.getElementById('edit' + t.innerText + 'Tab').style.display = 'none';
|
||||||
});
|
});
|
||||||
tab.classList.add('active');
|
tab.classList.add('active');
|
||||||
document.getElementById('edit' + tab.innerText + 'Tab').style.display = '';
|
const tabSection = document.getElementById('edit' + tab.innerText + 'Tab');
|
||||||
|
tabSection.style.display = '';
|
||||||
|
tabSection.scrollTop = 0;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue