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';
|
||||
|
||||
export function updateDictionary () {
|
||||
|
||||
renderDictionaryDetails();
|
||||
}
|
||||
|
||||
|
@ -49,6 +48,7 @@ export function openEditModal() {
|
|||
}
|
||||
|
||||
document.getElementById('editModal').style.display = '';
|
||||
Array.from(document.querySelectorAll('#editModal .modal-content section')).forEach(section => section.scrollTop = 0);
|
||||
}
|
||||
|
||||
export function saveEditModal() {
|
||||
|
|
|
@ -30,6 +30,7 @@ export function openSettingsModal() {
|
|||
showTemplateEditor(false);
|
||||
|
||||
document.getElementById('settingsModal').style.display = '';
|
||||
document.querySelector('#settingsModal .modal-content section').scrollTop = 0;
|
||||
}
|
||||
|
||||
export function updateTemplateSelects() {
|
||||
|
|
|
@ -35,7 +35,9 @@ function setupEditFormTabs() {
|
|||
document.getElementById('edit' + t.innerText + 'Tab').style.display = 'none';
|
||||
});
|
||||
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