aboutsummaryrefslogtreecommitdiff
path: root/ui/static/js/bootstrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/static/js/bootstrap.js')
-rw-r--r--ui/static/js/bootstrap.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/ui/static/js/bootstrap.js b/ui/static/js/bootstrap.js
index d07da563..95b0a681 100644
--- a/ui/static/js/bootstrap.js
+++ b/ui/static/js/bootstrap.js
@@ -38,7 +38,7 @@ document.addEventListener("DOMContentLoaded", function () {
onClick("a[data-toggle-bookmark]", () => handleBookmark());
onClick("a[data-fetch-content-entry]", () => handleFetchOriginalContent());
onClick("a[data-action=search]", (event) => setFocusToSearchInput(event));
- onClick("a[data-on-click=markPageAsRead]", () => markPageAsRead());
+ onClick("a[data-action=markPageAsRead]", () => handleConfirmationMessage(event.target, () => markPageAsRead()));
onClick("a[data-toggle-status]", (event) => {
let currentItem = DomHelper.findParent(event.target, "entry");
@@ -51,9 +51,19 @@ document.addEventListener("DOMContentLoaded", function () {
}
});
- onClick("a[data-confirm]", (event) => {
- (new ConfirmHandler()).handle(event);
- });
+ onClick("a[data-confirm]", (event) => handleConfirmationMessage(event.target, (url, redirectURL) => {
+ let request = new RequestBuilder(url);
+
+ request.withCallback(() => {
+ if (redirectURL) {
+ window.location.href = redirectURL;
+ } else {
+ window.location.reload();
+ }
+ });
+
+ request.execute();
+ }));
onClick("a[data-link-state=flip]", (event) => {
flipElementState(event.target);