diff options
author | silverwind <me@silverwind.io> | 2024-03-15 03:38:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 02:38:13 +0000 |
commit | 94512ee0628dc0d2b697441a4355ace54b6515cd (patch) | |
tree | 7ab0db88aa7c0dc0550b029a9384aec1382e2907 /templates | |
parent | 256a1eeb9a67b18c62a10f5909b584b7b220848a (diff) | |
download | gitea-94512ee0628dc0d2b697441a4355ace54b6515cd.tar.gz gitea-94512ee0628dc0d2b697441a4355ace54b6515cd.zip |
Fix Citation modal responsiveness and clipboard copy (#29799)
The modal was broken in two ways:
- On small screens, the input box was partially hanging outside the
modal. Fixed with flexbox and increased modal width.
- The clipboard copy was not working because the modal had both
`data-clipboard-text` and `data-clipboard-target`, while we only support
one of those. Made a small tweak in clipboard as well so that it will
still fall back to target if text is empty.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/cite/cite_buttons.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/cite/cite_modal.tmpl | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/templates/repo/cite/cite_buttons.tmpl b/templates/repo/cite/cite_buttons.tmpl index 9953c92c8a..426ca3858e 100644 --- a/templates/repo/cite/cite_buttons.tmpl +++ b/templates/repo/cite/cite_buttons.tmpl @@ -6,6 +6,6 @@ BibTeX </button> <!-- the value will be updated by initCitationFileCopyContent, the code below is used to avoid UI flicking --> <input id="citation-copy-content" value="" size="1" readonly> -<button class="ui icon button" id="citation-clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="" data-clipboard-target="#citation-copy-content"> +<button class="ui icon button" id="citation-clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-target="#citation-copy-content"> {{svg "octicon-copy"}} </button> diff --git a/templates/repo/cite/cite_modal.tmpl b/templates/repo/cite/cite_modal.tmpl index c34c77e0c4..fb251442ca 100644 --- a/templates/repo/cite/cite_modal.tmpl +++ b/templates/repo/cite/cite_modal.tmpl @@ -1,16 +1,14 @@ -<div class="ui tiny modal" id="cite-repo-modal"> +<div class="ui small modal" id="cite-repo-modal"> <div class="header"> {{ctx.Locale.Tr "repo.cite_this_repo"}} </div> <div class="content"> <div class="ui stackable secondary menu"> - <div class="fitted item"> - <div class="ui action input" id="citation-panel"> - {{template "repo/cite/cite_buttons" .}} - <a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{ctx.Locale.Tr "repo.find_file.go_to_file"}}"> - {{svg "octicon-file-moved"}} - </a> - </div> + <div class="ui action input" id="citation-panel"> + {{template "repo/cite/cite_buttons" .}} + <a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{ctx.Locale.Tr "repo.find_file.go_to_file"}}"> + {{svg "octicon-file-moved"}} + </a> </div> </div> </div> |