aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLunny Xiao2021-12-21 04:53:25 +0800
committerGitHub2021-12-20 15:53:25 -0500
commit91f5be889af4081b05d63aadecb1373689e1f57c (patch)
treea7ab5a1c752fb3fb236d11ba5fa674d813c63ec0
parenta818a48c76e4dcf0bf1e071623e05ff272869b67 (diff)
Fix delete u2f keys bug (#18042)
Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r--templates/user/settings/security_u2f.tmpl2
-rw-r--r--web_src/js/index.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/templates/user/settings/security_u2f.tmpl b/templates/user/settings/security_u2f.tmpl
index dcc56d872..b33c9ae0e 100644
--- a/templates/user/settings/security_u2f.tmpl
+++ b/templates/user/settings/security_u2f.tmpl
@@ -8,7 +8,7 @@
{{range .U2FRegistrations}}
<div class="item">
<div class="right floated content">
- <button class="ui red tiny button delete-button" id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
+ <button class="ui red tiny button delete-button" modal-id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
{{$.i18n.Tr "settings.delete_key"}}
</button>
</div>
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 1b096a31d..0a0cb1293 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -2959,8 +2959,8 @@ $(() => {
function showDeletePopup() {
const $this = $(this);
let filter = '';
- if ($this.attr('id')) {
- filter += `#${$this.attr('id')}`;
+ if ($this.attr('modal-id')) {
+ filter += `#${$this.attr('modal-id')}`;
}
const dialog = $(`.delete.modal${filter}`);