WebUI: simplify close window implementation

The caller site now take the responsibility to ensure the element is valid.

PR #21892.
This commit is contained in:
Chocobo1
2024-11-26 00:40:05 +08:00
committed by GitHub
parent 3ebdb50457
commit e1bd1038c0
9 changed files with 22 additions and 23 deletions

View File

@@ -21,11 +21,11 @@
event.preventDefault();
},
"Escape": (event) => {
window.parent.MochaUI.closeWindow(window.parent.$("newRulePage"));
window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault();
},
"Esc": (event) => {
window.parent.MochaUI.closeWindow(window.parent.$("newRulePage"));
window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault();
}
}
@@ -52,7 +52,7 @@
},
onSuccess: (response) => {
window.parent.qBittorrent.RssDownloader.updateRulesList();
window.parent.MochaUI.closeWindow(window.parent.$("newRulePage"));
window.parent.qBittorrent.Client.closeFrameWindow(window);
}
}).send();
});