Fix Bug 69126 - Files.Hotkeys. Added rename
This commit is contained in:
parent
888fe3700a
commit
d9d237d5c9
@ -14,6 +14,7 @@
|
||||
"HotkeysCreateSpreadsheet": "Create spreadsheet",
|
||||
"HotkeysCreatingObjects": "Creating items",
|
||||
"HotkeysCutSelected": "Cut selected items to the clipboard",
|
||||
"HotkeysRenameSelected": "Rename selected item",
|
||||
"HotkeysExtendSelectionDown": "Extend selection down",
|
||||
"HotkeysExtendSelectionLeft": "Extend selection left",
|
||||
"HotkeysExtendSelectionRight": "Extend selection right",
|
||||
|
@ -144,6 +144,18 @@ const withHotkeys = (Component) => {
|
||||
window.dispatchEvent(event);
|
||||
};
|
||||
|
||||
const onRename = () => {
|
||||
if (selection.length === 1) {
|
||||
const item = selection[0];
|
||||
|
||||
if (!item.contextOptions.includes("rename")) return;
|
||||
|
||||
const event = new Event(Events.RENAME);
|
||||
event.item = item;
|
||||
window.dispatchEvent(event);
|
||||
}
|
||||
};
|
||||
|
||||
const onCreateRoom = () => {
|
||||
if (!isVisitor && isRoomsFolder && security?.Create) {
|
||||
if (isGracePeriod) {
|
||||
@ -385,6 +397,8 @@ const withHotkeys = (Component) => {
|
||||
hotkeysFilter,
|
||||
);
|
||||
|
||||
useHotkeys("f2", onRename, hotkeysFilter);
|
||||
|
||||
//Upload file
|
||||
useHotkeys(
|
||||
"Shift+u",
|
||||
|
@ -73,6 +73,12 @@ const ActionsBlock = ({ t, textStyles, keyTextStyles, CtrlKey }) => {
|
||||
<Text {...keyTextStyles}> {CtrlKey} + x</Text>
|
||||
</>
|
||||
</Row>
|
||||
<Row className="hotkeys_row">
|
||||
<>
|
||||
<Text {...textStyles}>{t("HotkeysRenameSelected")}</Text>
|
||||
<Text {...keyTextStyles}> F2</Text>
|
||||
</>
|
||||
</Row>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user