Compare commits

...

2 commits

Author SHA1 Message Date
James Tan
19f37fe56a fix: Remove unneeded wrapper code 2024-07-16 21:13:51 -05:00
James Tan
c587f83890 fix: Change collapsed field from number to boolean 2024-07-16 21:13:25 -05:00

View file

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