mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-19 18:21:37 +08:00
feat(client): implement move to available/visible launchers on mobile as well
This commit is contained in:
parent
b367862fe8
commit
1369cd8b16
@ -34,8 +34,8 @@ export default class LauncherContextMenu implements SelectMenuItemEventListener<
|
|||||||
|
|
||||||
const isVisibleRoot = note?.noteId === "_lbVisibleLaunchers";
|
const isVisibleRoot = note?.noteId === "_lbVisibleLaunchers";
|
||||||
const isAvailableRoot = note?.noteId === "_lbAvailableLaunchers";
|
const isAvailableRoot = note?.noteId === "_lbAvailableLaunchers";
|
||||||
const isVisibleItem = parentNoteId === "_lbVisibleLaunchers";
|
const isVisibleItem = (parentNoteId === "_lbVisibleLaunchers" || parentNoteId === "_lbMobileVisibleLaunchers");
|
||||||
const isAvailableItem = parentNoteId === "_lbAvailableLaunchers";
|
const isAvailableItem = (parentNoteId === "_lbAvailableLaunchers" || parentNoteId === "_lbMobileAvailableLaunchers");
|
||||||
const isItem = isVisibleItem || isAvailableItem;
|
const isItem = isVisibleItem || isAvailableItem;
|
||||||
const canBeDeleted = !note?.noteId.startsWith("_"); // fixed notes can't be deleted
|
const canBeDeleted = !note?.noteId.startsWith("_"); // fixed notes can't be deleted
|
||||||
const canBeReset = !canBeDeleted && note?.isLaunchBarConfig();
|
const canBeReset = !canBeDeleted && note?.isLaunchBarConfig();
|
||||||
|
@ -1637,11 +1637,23 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
moveLauncherToVisibleCommand({ selectedOrActiveBranchIds }) {
|
moveLauncherToVisibleCommand({ selectedOrActiveBranchIds }) {
|
||||||
branchService.moveToParentNote(selectedOrActiveBranchIds, "_lbRoot__lbVisibleLaunchers");
|
this.#moveLaunchers(selectedOrActiveBranchIds, "_lbVisibleLaunchers", "_lbMobileVisibleLaunchers");
|
||||||
}
|
}
|
||||||
|
|
||||||
moveLauncherToAvailableCommand({ selectedOrActiveBranchIds }) {
|
moveLauncherToAvailableCommand({ selectedOrActiveBranchIds }) {
|
||||||
branchService.moveToParentNote(selectedOrActiveBranchIds, "_lbRoot__lbAvailableLaunchers");
|
this.#moveLaunchers(selectedOrActiveBranchIds, "_lbAvailableLaunchers", "_lbMobileAvailableLaunchers");
|
||||||
|
}
|
||||||
|
|
||||||
|
#moveLaunchers(selectedOrActiveBranchIds, desktopParent, mobileParent) {
|
||||||
|
const desktopLaunchersToMove = selectedOrActiveBranchIds.filter((branchId) => !branchId.startsWith("_lbMobile"));
|
||||||
|
if (desktopLaunchersToMove) {
|
||||||
|
branchService.moveToParentNote(desktopLaunchersToMove, "_lbRoot_" + desktopParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
const mobileLaunchersToMove = selectedOrActiveBranchIds.filter((branchId) => branchId.startsWith("_lbMobile"));
|
||||||
|
if (mobileLaunchersToMove) {
|
||||||
|
branchService.moveToParentNote(mobileLaunchersToMove, "_lbMobileRoot_" + mobileParent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addNoteLauncherCommand({ node }) {
|
addNoteLauncherCommand({ node }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user