1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add remove button in feed edit page

This commit is contained in:
Frédéric Guillot 2018-08-25 12:21:54 -07:00
parent febce4f2e3
commit 551b73acfb
7 changed files with 43 additions and 10 deletions

View file

@ -58,6 +58,7 @@ document.addEventListener("DOMContentLoaded", function() {
});
mouseHandler.onClick("a[data-on-click=markPageAsRead]", () => navHandler.markPageAsRead());
mouseHandler.onClick("a[data-confirm]", (event) => {
(new ConfirmHandler()).handle(event);
});

View file

@ -1,7 +1,15 @@
class ConfirmHandler {
remove(url) {
executeRequest(url, redirectURL) {
let request = new RequestBuilder(url);
request.withCallback(() => window.location.reload());
request.withCallback(() => {
if (redirectURL) {
window.location.href = redirectURL;
} else {
window.location.reload();
}
});
request.execute();
}
@ -24,7 +32,7 @@ class ConfirmHandler {
questionElement.remove();
containerElement.appendChild(loadingElement);
this.remove(linkElement.dataset.url);
this.executeRequest(linkElement.dataset.url, linkElement.dataset.redirectUrl);
};
let noElement = document.createElement("a");