mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	feat(mobile): support move/clone to 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. |     *   The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to | ||||||
|     *   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 | ||||||
|   | |||||||
| @@ -10,23 +10,18 @@ import Component from "./component.js"; | |||||||
|  * must be at the root of the component tree. |  * must be at the root of the component tree. | ||||||
|  */ |  */ | ||||||
| export default class MainTreeExecutors extends Component { | export default class MainTreeExecutors extends Component { | ||||||
|  |     /** | ||||||
|  |      * On mobile it will be `undefined`. | ||||||
|  |      */ | ||||||
|     get tree() { |     get tree() { | ||||||
|         return appContext.noteTreeWidget; |         return appContext.noteTreeWidget; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     async cloneNotesToCommand({ selectedOrActiveNoteIds }: EventData<"cloneNotesTo">) { |     async cloneNotesToCommand({ selectedOrActiveNoteIds }: EventData<"cloneNotesTo">) { | ||||||
|         if (!this.tree) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         this.triggerCommand("cloneNoteIdsTo", { noteIds: selectedOrActiveNoteIds }); |         this.triggerCommand("cloneNoteIdsTo", { noteIds: selectedOrActiveNoteIds }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     async moveNotesToCommand({ selectedOrActiveBranchIds }: EventData<"moveNotesTo">) { |     async moveNotesToCommand({ selectedOrActiveBranchIds }: EventData<"moveNotesTo">) { | ||||||
|         if (!this.tree) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         this.triggerCommand("moveBranchIdsTo", { branchIds: selectedOrActiveBranchIds }); |         this.triggerCommand("moveBranchIdsTo", { branchIds: selectedOrActiveBranchIds }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -255,8 +255,6 @@ export default class DesktopLayout { | |||||||
|             // Remove once modals are all merged |             // Remove once modals are all merged | ||||||
|             .child(new PasswordNoteSetDialog()) |             .child(new PasswordNoteSetDialog()) | ||||||
|  |  | ||||||
|             .child(new CloneToDialog()) |  | ||||||
|             .child(new MoveToDialog()) |  | ||||||
|             .child(new ImportDialog()) |             .child(new ImportDialog()) | ||||||
|             .child(new ExportDialog()) |             .child(new ExportDialog()) | ||||||
|             .child(new UploadAttachmentsDialog()) |             .child(new UploadAttachmentsDialog()) | ||||||
|   | |||||||
| @@ -11,6 +11,8 @@ import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js"; | |||||||
| import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js"; | import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js"; | ||||||
| import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js"; | import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js"; | ||||||
| import NoteTypeChooserDialog from "../widgets/dialogs/note_type_chooser.js"; | import NoteTypeChooserDialog from "../widgets/dialogs/note_type_chooser.js"; | ||||||
|  | import MoveToDialog from "../widgets/dialogs/move_to.js"; | ||||||
|  | import CloneToDialog from "../widgets/dialogs/clone_to.js"; | ||||||
|  |  | ||||||
| export function applyModals(rootContainer: RootContainer) { | export function applyModals(rootContainer: RootContainer) { | ||||||
|     rootContainer |     rootContainer | ||||||
| @@ -24,8 +26,8 @@ export function applyModals(rootContainer: RootContainer) { | |||||||
|         .child(new NoteTypeChooserDialog()) |         .child(new NoteTypeChooserDialog()) | ||||||
|         .child(new JumpToNoteDialog()) |         .child(new JumpToNoteDialog()) | ||||||
|         .child(new AddLinkDialog()) |         .child(new AddLinkDialog()) | ||||||
|     //     .child(new CloneToDialog()) |         .child(new CloneToDialog()) | ||||||
|     //     .child(new MoveToDialog()) |         .child(new MoveToDialog()) | ||||||
|     //     .child(new ImportDialog()) |     //     .child(new ImportDialog()) | ||||||
|     //     .child(new ExportDialog()) |     //     .child(new ExportDialog()) | ||||||
|     //     .child(new UploadAttachmentsDialog()) |     //     .child(new UploadAttachmentsDialog()) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user