mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 01:36:24 +01:00 
			
		
		
		
	feat(mobile): add note revisions dialog
This commit is contained in:
		| @@ -20,7 +20,7 @@ | |||||||
|     *   Document structure is now precalculated, so start-up time should be slightly increased. |     *   Document structure is now precalculated, so start-up time should be slightly increased. | ||||||
|     *   Optimized the content in order to reduce the size on disk. |     *   Optimized the content in order to reduce the size on disk. | ||||||
| *   Mobile improvements: | *   Mobile improvements: | ||||||
|     *   The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import |     *   The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import, note revisions | ||||||
|     *   Modals now have a safe margin on their bottom and are scrollable. |     *   Modals now have a safe margin on their bottom and are scrollable. | ||||||
|  |  | ||||||
| ## 🌍 Internationalization | ## 🌍 Internationalization | ||||||
|   | |||||||
| @@ -256,7 +256,6 @@ export default class DesktopLayout { | |||||||
|             .child(new PasswordNoteSetDialog()) |             .child(new PasswordNoteSetDialog()) | ||||||
|  |  | ||||||
|             .child(new UploadAttachmentsDialog()) |             .child(new UploadAttachmentsDialog()) | ||||||
|             .child(new RevisionsDialog()) |  | ||||||
|             .child(new DeleteNotesDialog()) |             .child(new DeleteNotesDialog()) | ||||||
|             .child(new InfoDialog()) |             .child(new InfoDialog()) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -18,6 +18,7 @@ import ExportDialog from "../widgets/dialogs/export.js"; | |||||||
| import MarkdownImportDialog from "../widgets/dialogs/markdown_import.js"; | import MarkdownImportDialog from "../widgets/dialogs/markdown_import.js"; | ||||||
| import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js"; | import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js"; | ||||||
| import ConfirmDialog from "../widgets/dialogs/confirm.js"; | import ConfirmDialog from "../widgets/dialogs/confirm.js"; | ||||||
|  | import RevisionsDialog from "../widgets/dialogs/revisions.js"; | ||||||
|  |  | ||||||
| export function applyModals(rootContainer: RootContainer) { | export function applyModals(rootContainer: RootContainer) { | ||||||
|     rootContainer |     rootContainer | ||||||
| @@ -37,7 +38,7 @@ export function applyModals(rootContainer: RootContainer) { | |||||||
|         .child(new ExportDialog()) |         .child(new ExportDialog()) | ||||||
|         .child(new MarkdownImportDialog()) |         .child(new MarkdownImportDialog()) | ||||||
|         .child(new ProtectedSessionPasswordDialog()) |         .child(new ProtectedSessionPasswordDialog()) | ||||||
|     //     .child(new RevisionsDialog()) |         .child(new RevisionsDialog()) | ||||||
|     //     .child(new DeleteNotesDialog()) |     //     .child(new DeleteNotesDialog()) | ||||||
|     //     .child(new InfoDialog()) |     //     .child(new InfoDialog()) | ||||||
|         .child(new ConfirmDialog()) |         .child(new ConfirmDialog()) | ||||||
|   | |||||||
| @@ -24,12 +24,14 @@ class MobileDetailMenuWidget extends BasicWidget { | |||||||
|         this.$widget.on("click", async (e) => { |         this.$widget.on("click", async (e) => { | ||||||
|             const note = appContext.tabManager.getActiveContextNote(); |             const note = appContext.tabManager.getActiveContextNote(); | ||||||
|  |  | ||||||
|             contextMenu.show({ |             contextMenu.show<"insertChildNote" | "delete" | "showRevisions">({ | ||||||
|                 x: e.pageX, |                 x: e.pageX, | ||||||
|                 y: e.pageY, |                 y: e.pageY, | ||||||
|                 items: [ |                 items: [ | ||||||
|                     { title: t("mobile_detail_menu.insert_child_note"), command: "insertChildNote", uiIcon: "bx bx-plus", enabled: note?.type !== "search" }, |                     { title: t("mobile_detail_menu.insert_child_note"), command: "insertChildNote", uiIcon: "bx bx-plus", enabled: note?.type !== "search" }, | ||||||
|                     { title: t("mobile_detail_menu.delete_this_note"), command: "delete", uiIcon: "bx bx-trash", enabled: note?.noteId !== "root" } |                     { title: t("mobile_detail_menu.delete_this_note"), command: "delete", uiIcon: "bx bx-trash", enabled: note?.noteId !== "root" }, | ||||||
|  |                     { title: "----" }, | ||||||
|  |                     { title: "Note revisions", command: "showRevisions", uiIcon: "bx bx-history" } | ||||||
|                 ], |                 ], | ||||||
|                 selectMenuItemHandler: async ({ command }) => { |                 selectMenuItemHandler: async ({ command }) => { | ||||||
|                     if (command === "insertChildNote") { |                     if (command === "insertChildNote") { | ||||||
| @@ -49,8 +51,8 @@ class MobileDetailMenuWidget extends BasicWidget { | |||||||
|                         if (await branchService.deleteNotes([branchId])) { |                         if (await branchService.deleteNotes([branchId])) { | ||||||
|                             this.triggerCommand("setActiveScreen", { screen: "tree" }); |                             this.triggerCommand("setActiveScreen", { screen: "tree" }); | ||||||
|                         } |                         } | ||||||
|                     } else { |                     } else if (command) { | ||||||
|                         throw new Error(t("mobile_detail_menu.error_unrecognized_command", { command })); |                         this.triggerCommand(command); | ||||||
|                     } |                     } | ||||||
|                 }, |                 }, | ||||||
|                 forcePositionOnMobile: true |                 forcePositionOnMobile: true | ||||||
|   | |||||||
| @@ -1430,6 +1430,34 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu { | |||||||
|         position: static !important; |         position: static !important; | ||||||
|         border: 0 !important; |         border: 0 !important; | ||||||
|         border-radius: 0 !important; |         border-radius: 0 !important; | ||||||
|  |         font-size: 1rem !important; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     body.mobile .revisions-dialog .modal-dialog { | ||||||
|  |         height: 95vh; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     body.mobile .revisions-dialog .modal-body { | ||||||
|  |         height: 100% !important; | ||||||
|  |         flex-direction: column; | ||||||
|  |         padding: 0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     body.mobile .revisions-dialog .revision-list { | ||||||
|  |         height: unset; | ||||||
|  |         max-height: 20vh; | ||||||
|  |         border-bottom: 1px solid var(--main-border-color) !important; | ||||||
|  |         padding: 0 1em; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     body.mobile .revisions-dialog .modal-body > .revision-content-wrapper { | ||||||
|  |         flex-grow: 1; | ||||||
|  |         height: 100%; | ||||||
|  |         overflow: auto; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     body.mobile .revisions-dialog .modal-body > .revision-content-wrapper > div:first-of-type { | ||||||
|  |         flex-direction: column; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user