From 7e108a85cbbd4830c4ebab49bec139cfa0be78df Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 26 Feb 2024 14:53:33 +0100 Subject: [PATCH] right-align the buttons --- src/tracker.ts | 5 +++-- styles.css | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tracker.ts b/src/tracker.ts index 02ed3b6..6dd0260 100644 --- a/src/tracker.ts +++ b/src/tracker.ts @@ -42,7 +42,7 @@ export function loadTracker(json: string): Tracker { } export function displayTracker(tracker: Tracker, element: HTMLElement, file: string, getSectionInfo: () => MarkdownSectionInformation, settings: SimpleTimeTrackerSettings): void { - element.classList.add("simple-time-tracker-container"); + element.addClass("simple-time-tracker-container"); // add start/stop controls let running = isRunning(tracker); let btn = new ButtonComponent(element) @@ -305,7 +305,7 @@ class EditableField { this.label = this.cell.createEl("span", {text: value}); this.label.style.marginLeft = `${indent}em`; this.box = new TextComponent(this.cell).setValue(value); - this.box.inputEl.classList.add("simple-time-tracker-input"); + this.box.inputEl.addClass("simple-time-tracker-input"); this.box.inputEl.hide(); } @@ -373,6 +373,7 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle row.createEl("td", {text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry), settings) : ""}); let entryButtons = row.createEl("td"); + entryButtons.addClass("simple-time-tracker-table-buttons"); new ButtonComponent(entryButtons) .setClass("clickable-icon") .setIcon(`lucide-play`) diff --git a/styles.css b/styles.css index 6f55554..bb7f205 100644 --- a/styles.css +++ b/styles.css @@ -71,3 +71,7 @@ max-width: 150px; min-width: 100px; } + +.simple-time-tracker-table-buttons { + text-align: right !important; +}