diff options
author | Mario Lubenka <mario.lubenka@googlemail.com> | 2021-10-19 19:32:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 13:32:11 -0400 |
commit | 0208ea0248782a994771cadf0af6a4125fdde723 (patch) | |
tree | 786adbf64e1a8805d30361a21d97bf1fdf8bba05 /web_src/js | |
parent | de61816623b80bfdc45b51bbce75f4d388da7218 (diff) | |
download | gitea-0208ea0248782a994771cadf0af6a4125fdde723.tar.gz gitea-0208ea0248782a994771cadf0af6a4125fdde723.zip |
"Copy branch name" button in pull request (#17323)
* Drop data-original from clipboard
data-original attribute was removed. Instead, the original value from
data-content is set after success/fail message was displayed.
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* "Copy branch name" button in pull request
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Update templates/repo/issue/view_title.tmpl
Co-authored-by: silverwind <me@silverwind.io>
* Apply suggestions from code review
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/clipboard.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/web_src/js/features/clipboard.js b/web_src/js/features/clipboard.js index 2c7ad013bd..8d28b4e281 100644 --- a/web_src/js/features/clipboard.js +++ b/web_src/js/features/clipboard.js @@ -4,16 +4,18 @@ function onSuccess(btn) { if (!btn.dataset.content) return; $(btn).popup('destroy'); + const oldContent = btn.dataset.content; btn.dataset.content = btn.dataset.success; $(btn).popup('show'); - btn.dataset.content = btn.dataset.original; + btn.dataset.content = oldContent; } function onError(btn) { if (!btn.dataset.content) return; + const oldContent = btn.dataset.content; $(btn).popup('destroy'); btn.dataset.content = btn.dataset.error; $(btn).popup('show'); - btn.dataset.content = btn.dataset.original; + btn.dataset.content = oldContent; } /** |