diff --git a/src/json/shortcut.ts b/src/json/shortcut.ts index 80797d08c5..70aece5385 100644 --- a/src/json/shortcut.ts +++ b/src/json/shortcut.ts @@ -33,8 +33,8 @@ const getSections = () => { { id: 'lock', name: translate('popupShortcutMainBasics22'), keys: [ cmdKey, 'alt', 'l' ] }, { id: 'undo', name: translate('popupShortcutMainBasics6'), keys: [ cmdKey, 'z' ] }, { id: 'redo', name: translate('popupShortcutMainBasics7'), keys: [ cmdKey, 'shift', 'z' ] }, - { id: 'createWidget', name: translate('popupShortcutMainBasics25'), keys: [ cmdKey, 'shift', 'w' ] }, - { id: 'copyPageLink', name: translate('popupShortcutCopyPageLink'), keys: [ cmdKey, 'shift', 'c' ] }, + { id: 'createWidget', name: translate('menuObjectCreateWidget'), keys: [] }, + { id: 'copyPageLink', name: translate('commonCopyLink'), keys: [] }, ] }, diff --git a/src/json/text.json b/src/json/text.json index 707e2251f2..e410dbbbbb 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -1303,7 +1303,6 @@ "popupShortcutMainBasics22": "Lock Anytype", "popupShortcutMainBasics23": "Previous Space", "popupShortcutMainBasics24": "Lock / Unlock Object", - "popupShortcutMainBasics25": "Create widget", "popupShortcutMainTextStyle": "Text style", "popupShortcutMainTextStyle1": "Bold", diff --git a/src/ts/lib/keyboard.ts b/src/ts/lib/keyboard.ts index e97f793488..4df823d1a2 100644 --- a/src/ts/lib/keyboard.ts +++ b/src/ts/lib/keyboard.ts @@ -152,9 +152,11 @@ class Keyboard { const isMain = this.isMain(); const canWrite = U.Space.canMyParticipantWrite(); const selection = S.Common.getRef('selectionProvider'); + const rootId = this.getRootId(); this.shortcut('toggleSidebar', e, () => { e.preventDefault(); + sidebar.toggleOpenClose(); }); @@ -309,7 +311,6 @@ class Keyboard { this.shortcut('createWidget', e, () => { e.preventDefault(); - const rootId = this.getRootId(); const first = S.Block.getFirstBlock(S.Block.widgets, 1, it => it.isWidget()); Action.createWidgetFromObject(rootId, rootId, first?.id, I.BlockPosition.Top, analytics.route.shortcut); @@ -318,9 +319,10 @@ class Keyboard { // Copy page link this.shortcut('copyPageLink', e, () => { e.preventDefault(); - const rootId = this.getRootId(); + const object = S.Detail.get(rootId, rootId); const space = U.Space.getSpaceview(); + U.Object.copyLink(object, space, 'web', analytics.route.shortcut); });