1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

JS-6295: open space settings shortcut

This commit is contained in:
Andrew Simachev 2025-06-05 16:17:50 +02:00
parent 9bc401302f
commit 902b4d0efd
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF
3 changed files with 19 additions and 10 deletions

View file

@ -54,6 +54,7 @@ const getSections = () => {
{
name: translate('popupShortcutNavigation'), children: [
{ id: 'settings', name: translate('popupShortcutNavigationBasics1'), keys: [ cmdKey, 'comma' ] },
{ id: 'settingsSpace', name: translate('popupShortcutNavigationBasics12'), keys: [] },
{ id: 'navigation', name: translate('popupShortcutNavigationBasics2'), keys: [ cmdKey, 'o' ] },
{ id: 'graph', name: translate('popupShortcutNavigationBasics3'), keys: [ cmdKey, 'alt', 'o' ] },
{ id: 'search', name: translate('popupShortcutNavigationBasics4'), keys: [ cmdKey, 'k' ] },

View file

@ -1354,6 +1354,7 @@
"popupShortcutNavigationBasics9": "Open in a modal window",
"popupShortcutNavigationBasics10": "Open in a new window",
"popupShortcutNavigationBasics11": "Open Bin",
"popupShortcutNavigationBasics12": "Space Settings",
"popupShortcutNavigationPage9": "Open Properties",
"popupShortcutEditorTurn0": "Turn block into a text block",

View file

@ -307,18 +307,11 @@ class Keyboard {
U.Object.copyLink(object, space, 'web', analytics.route.shortcut);
});
// Move to bin
this.shortcut('moveToBin', e, () => {
// Settings
this.shortcut('settingsSpace', e, () => {
e.preventDefault();
Action[object.isArchived ? 'restore' : 'archive']([ rootId ], analytics.route.shortcut);
});
// Add to favorites
this.shortcut('addFavorite', e, () => {
e.preventDefault();
Action.setIsFavorite([ rootId ], !object.isFavorite, analytics.route.shortcut);
U.Object.openRoute({ id: 'spaceIndex', layout: I.ObjectLayout.Settings });
});
if (canWrite) {
@ -341,6 +334,20 @@ class Keyboard {
// Lock/Unlock
this.shortcut('pageLock', e, () => this.onToggleLock());
// Move to bin
this.shortcut('moveToBin', e, () => {
e.preventDefault();
Action[object.isArchived ? 'restore' : 'archive']([ rootId ], analytics.route.shortcut);
});
// Add to favorites
this.shortcut('addFavorite', e, () => {
e.preventDefault();
Action.setIsFavorite([ rootId ], !object.isFavorite, analytics.route.shortcut);
});
};
};