add add/edit transaction category dialog

This commit is contained in:
MaysWind
2023-08-07 00:55:13 +08:00
parent 1753a6c247
commit c33c0487cf
7 changed files with 601 additions and 13 deletions
+12 -7
View File
@@ -19,19 +19,24 @@ export function getCssValue(element, name) {
return computedStyle.getPropertyValue(name);
}
export function scrollToMenuListItem(listContentEl) {
if (!listContentEl) {
export function scrollToSelectedItem(parentEl, containerSelector, selectedItemSelector) {
if (!parentEl) {
return;
}
const lists = listContentEl.querySelectorAll('div.v-list');
let container = parentEl;
if (!lists.length || !lists[0]) {
return;
if (containerSelector) {
const lists = parentEl.querySelectorAll(containerSelector);
if (!lists.length || !lists[0]) {
return;
}
container = lists[0];
}
const container = lists[0];
const selectedItems = container.querySelectorAll('div.v-list-item.list-item-selected');
const selectedItems = container.querySelectorAll(selectedItemSelector);
if (!selectedItems.length || !selectedItems[0]) {
return;