mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-12 20:48:40 +00:00
fix(ui): fix markdown editor monospace preference in pages with multiple editors (#13329)
Makes sure the markdown editor's monospace preference gets applied even within pages containing multiple editors. Fixes https://codeberg.org/forgejo/forgejo/issues/13186 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13329 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
parent
da8d5a8aef
commit
fe8d4c3f3f
3 changed files with 49 additions and 7 deletions
|
|
@ -52,13 +52,13 @@ Template Attributes:
|
|||
</markdown-toolbar>
|
||||
<div class="ui tab active" data-tab-panel="markdown-writer">
|
||||
<text-expander keys=": @" suffix="">
|
||||
<textarea class="markdown-text-editor js-quick-submit"{{if .TextareaName}} name="{{.TextareaName}}"{{end}}{{if .TextareaPlaceholder}} placeholder="{{.TextareaPlaceholder}}"{{end}}{{if .TextareaAriaLabel}} aria-label="{{.TextareaAriaLabel}}"{{end}}{{if .DisableAutosize}} data-disable-autosize="{{.DisableAutosize}}"{{end}}>{{.TextareaContent}}</textarea>
|
||||
<textarea class="markdown-text-editor js-quick-submit"
|
||||
{{- if .TextareaName}} name="{{.TextareaName}}"{{end -}}
|
||||
{{if .TextareaPlaceholder}} placeholder="{{.TextareaPlaceholder}}"{{end -}}
|
||||
{{if .TextareaAriaLabel}} aria-label="{{.TextareaAriaLabel}}"{{end -}}
|
||||
{{if .DisableAutosize}} data-disable-autosize="{{.DisableAutosize}}"{{end -}}
|
||||
>{{.TextareaContent}}</textarea>
|
||||
</text-expander>
|
||||
<script>
|
||||
if (localStorage?.getItem('markdown-editor-monospace') === 'true') {
|
||||
document.querySelector('.markdown-text-editor').classList.add('tw-font-mono');
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<div class="ui tab markup" data-tab-panel="markdown-previewer">
|
||||
{{ctx.Locale.Tr "loading"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue