Skip to content

Commit

Permalink
make activity changes textbox readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Jan 13, 2025
1 parent 7595e0b commit d1585f8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
17 changes: 17 additions & 0 deletions frontend/viewer/src/app.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,20 @@
.AppBar :has(> [slot="actions"]) {
flex-grow: 0;
}

/* the input must also be disabled, otherwise it will be editable*/
.input-readonly {
&.TextField, .TextField {
opacity: 1;

input, textarea {
/* enable standard text selection */
pointer-events: auto;
cursor: text;
}

.append {
display: none;
}
}
}
3 changes: 2 additions & 1 deletion frontend/viewer/src/lib/activity/ActivityView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@
{#if selectedRow}
<TextField label="Changes"
value={JSON.stringify(selectedRow.changes, null, 4)}
disabled
multiline
class="readonly"
class="input-readonly"
classes={{input: 'h-80'}}/>
{/if}
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/viewer/src/lib/history/HistoryView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@
<div>
{#if record?.entity}
{#if record.entityName === 'Entry'}
<EntryEditor entry={record.entity} modalMode/>
<EntryEditor entry={record.entity} modalMode readonly/>
{:else if record.entityName === 'Sense'}
<div class="editor-grid">
<SenseEditor sense={record.entity}/>
<SenseEditor sense={record.entity} readonly/>
</div>
{:else if record.entityName === 'ExampleSentence'}
<div class="editor-grid">
<ExampleEditor example={record.entity} readonly={false}/>
<ExampleEditor example={record.entity} readonly/>
</div>
{/if}
{/if}
Expand Down

0 comments on commit d1585f8

Please sign in to comment.