diff --git a/templates/webhook/shared-settings.tmpl b/templates/webhook/shared-settings.tmpl
index 60b09ab172..47bce87e9e 100644
--- a/templates/webhook/shared-settings.tmpl
+++ b/templates/webhook/shared-settings.tmpl
@@ -208,7 +208,7 @@
{{else}}
-
{{ctx.Locale.Tr "repo.settings.delete_webhook"}}
+
{{ctx.Locale.Tr "repo.settings.delete_webhook"}}
{{end}}
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index a99af0ef25..a6c2829b53 100644
--- a/web_src/js/features/common-global.js
+++ b/web_src/js/features/common-global.js
@@ -369,12 +369,13 @@ export function initGlobalLinkActions() {
e.preventDefault();
const $this = $(this || e.target);
const dataArray = $this.data();
- let filter = '';
- if ($this[0].getAttribute('data-modal-id')) {
- filter += `#${$this[0].getAttribute('data-modal-id')}`;
+
+ const modalID = $this[0].getAttribute('data-modal-id');
+ if (!modalID) {
+ throw new Error('This button does not specify which modal it wants to open.');
}
- const $dialog = $(`.delete.modal${filter}`);
+ const $dialog = $(`#${modalID}`);
$dialog.find('.name').text($this.data('name'));
for (const [key, value] of Object.entries(dataArray)) {
if (key && key.startsWith('data')) {