Compare commits

..

No commits in common. "19f37fe56ae89e7198016b318b5cf334e6dadcad" and "f308679bd2a9474194c50edc8e65676dd8fe5bb4" have entirely different histories.

View file

@ -10,7 +10,7 @@ export interface Entry {
startTime: string; startTime: string;
endTime: string; endTime: string;
subEntries: Entry[]; subEntries: Entry[];
collapsed?: boolean; collapsed?: number;
} }
export async function saveTracker(tracker: Tracker, app: App, fileName: string, section: MarkdownSectionInformation): Promise<void> { export async function saveTracker(tracker: Tracker, app: App, fileName: string, section: MarkdownSectionInformation): Promise<void> {
@ -328,12 +328,16 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle
if (entry.collapsed) { if (entry.collapsed) {
delete entry.collapsed; delete entry.collapsed;
} else { } else {
entry.collapsed = true; entry.collapsed = 1;
} }
await saveTracker(tracker, this.app, getFile(), getSectionInfo()); await saveTracker(tracker, this.app, getFile(), getSectionInfo());
}); });
if (!entry.subEntries?.length) expandButton.buttonEl.style.visibility = 'hidden'; if (!entry.subEntries?.length) expandButton.buttonEl.style.visibility = 'hidden';
nameField.cell.insertBefore(expandButton.buttonEl, nameField.label); let nameWrapper = nameField.cell.createDiv({cls: "simple-time-tracker-table-expandwrapper"});
nameWrapper.style.marginLeft = nameField.label.style.marginLeft;
nameField.label.style.marginLeft = null;
nameWrapper.insertBefore(expandButton.buttonEl, null);
nameWrapper.insertBefore(nameField.label, null);
let entryButtons = row.createEl("td"); let entryButtons = row.createEl("td");
entryButtons.addClass("simple-time-tracker-table-buttons"); entryButtons.addClass("simple-time-tracker-table-buttons");