]> git.proxmox.com Git - pmg-gui.git/commitdiff
mobile: show toast instead of annoying prompt
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 30 Oct 2020 14:00:46 +0000 (15:00 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 30 Oct 2020 14:00:46 +0000 (15:00 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/mobile/app.js
js/mobile/utils.js

index 4d00c12c6e24ee2062230b8336f04717f66782b7..cf76e8e0655c246a6805d72bc12b25fffa812d3b 100644 (file)
@@ -43,18 +43,10 @@ app = new Framework7({
                            },
                            success: (data, status, xhr) => {
                                loader.close();
-                               app.dialog.alert(
-                                   `Action '${action}' successful`,
-                                   gettext("Info"),
-                                   () => {
-                                       if (action === 'delete' ||
-                                           action === 'deliver') {
-                                           // refresh the main list when a mail
-                                           // got deleted or delivered
-                                           app.ptr.refresh();
-                                       }
-                                   },
-                               );
+                               PMG.Utils.showSuccessToast(`${action} successful`);
+                               if (action === 'delete' || action === 'deliver') {
+                                   app.ptr.refresh();
+                               }
                                reject();
                            },
                            error: xhr => {
index 9e6eb667ba8dd8f9ff875a7e357e617a4462f188..33ed019a1e77d8edca0c4779983165160b0515ea 100644 (file)
@@ -68,6 +68,14 @@ PMG = {
                destroyOnClose: true,
            });
        },
+       showSuccessToast(msg) {
+           app.toast.show({
+               text: msg,
+               closeTimeout: 2000,
+               closeButton: true,
+               destroyOnClose: true,
+           });
+       },
        extractParams() {
            let queryObj = app.utils.parseUrlQuery(location.search);
            let mail, action, date, username, ticket;