mirror of
https://github.com/Ellpeck/ObsidianSimpleTimeTracker.git
synced 2024-11-28 03:58:34 +01:00
fix: Retain old formatting when editing row
This commit is contained in:
parent
d7b7b5ba1e
commit
f308679bd2
1 changed files with 2 additions and 6 deletions
|
@ -357,9 +357,7 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
if (nameField.editing()) {
|
if (nameField.editing()) {
|
||||||
entry.name = nameField.endEdit();
|
entry.name = nameField.endEdit();
|
||||||
if (entry.subEntries?.length) {
|
expandButton.buttonEl.style.display = null;
|
||||||
expandButton.buttonEl.style.display = null;
|
|
||||||
}
|
|
||||||
startField.endEdit();
|
startField.endEdit();
|
||||||
entry.startTime = startField.getTimestamp();
|
entry.startTime = startField.getTimestamp();
|
||||||
if (!entryRunning) {
|
if (!entryRunning) {
|
||||||
|
@ -372,9 +370,7 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle
|
||||||
renderNameAsMarkdown(nameField.label, getFile, component);
|
renderNameAsMarkdown(nameField.label, getFile, component);
|
||||||
} else {
|
} else {
|
||||||
nameField.beginEdit(entry.name);
|
nameField.beginEdit(entry.name);
|
||||||
if (entry.subEntries?.length) {
|
expandButton.buttonEl.style.display = 'none';
|
||||||
expandButton.buttonEl.style.display = 'none';
|
|
||||||
}
|
|
||||||
// only allow editing start and end times if we don't have sub entries
|
// only allow editing start and end times if we don't have sub entries
|
||||||
if (!entry.subEntries) {
|
if (!entry.subEntries) {
|
||||||
startField.beginEdit(entry.startTime);
|
startField.beginEdit(entry.startTime);
|
||||||
|
|
Loading…
Reference in a new issue