diff --git a/web/src/rename-dialog.js b/web/src/rename-dialog.js index 495ae8148..08ae76ac8 100644 --- a/web/src/rename-dialog.js +++ b/web/src/rename-dialog.js @@ -26,6 +26,8 @@ export class RenameDialog extends EventTarget { this.torrents = torrents; this.elements = RenameDialog._create(); + this.elements.dismiss.addEventListener('click', () => this._onDismiss()); + this.elements.confirm.addEventListener('click', () => this._onConfirm()); this.elements.entry.value = torrents[0].getName(); document.body.append(this.elements.root); @@ -65,8 +67,6 @@ export class RenameDialog extends EventTarget { elements.root.setAttribute('aria-label', 'Rename Torrent'); elements.heading.textContent = 'Enter new name:'; elements.confirm.textContent = 'Rename'; - elements.dismiss.addEventListener('click', () => this._onDismiss()); - elements.confirm.addEventListener('click', () => this._onConfirm()); const label = document.createElement('label'); label.setAttribute('for', 'torrent-rename-name');