mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
This commit is contained in:
parent
3e3b319653
commit
0c1325fbc5
@ -328,6 +328,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
|
focusByRange(range)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const selectElement: Element[] = [];
|
const selectElement: Element[] = [];
|
||||||
@ -362,6 +363,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
|
focusByRange(range)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -811,6 +811,7 @@ export class Gutter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
const range = getSelection().rangeCount > 0 ? getSelection().getRangeAt(0) : undefined
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.addToDatabase,
|
label: window.siyuan.languages.addToDatabase,
|
||||||
accelerator: window.siyuan.config.keymap.general.addToDatabase.custom,
|
accelerator: window.siyuan.config.keymap.general.addToDatabase.custom,
|
||||||
@ -838,7 +839,7 @@ export class Gutter {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
focusBlock(selectsElement[0]);
|
focusByRange(range);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
@ -1278,6 +1279,7 @@ export class Gutter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
const range = getSelection().rangeCount > 0 ? getSelection().getRangeAt(0) : undefined
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.addToDatabase,
|
label: window.siyuan.languages.addToDatabase,
|
||||||
accelerator: window.siyuan.config.keymap.general.addToDatabase.custom,
|
accelerator: window.siyuan.config.keymap.general.addToDatabase.custom,
|
||||||
@ -1302,7 +1304,7 @@ export class Gutter {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
focusBlock(nodeElement);
|
focusByRange(range);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
@ -23,6 +23,7 @@ import {genImportMenu} from "../../menus/navigation";
|
|||||||
import {transferBlockRef} from "../../menus/block";
|
import {transferBlockRef} from "../../menus/block";
|
||||||
import {openSearchAV} from "../render/av/relation";
|
import {openSearchAV} from "../render/av/relation";
|
||||||
import {transaction} from "../wysiwyg/transaction";
|
import {transaction} from "../wysiwyg/transaction";
|
||||||
|
import {focusByRange} from "../util/selection";
|
||||||
|
|
||||||
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
hideTooltip();
|
hideTooltip();
|
||||||
@ -44,6 +45,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
|||||||
}).element);
|
}).element);
|
||||||
if (!protyle.disabled) {
|
if (!protyle.disabled) {
|
||||||
window.siyuan.menus.menu.append(movePathToMenu([protyle.path]));
|
window.siyuan.menus.menu.append(movePathToMenu([protyle.path]));
|
||||||
|
const range = getSelection().rangeCount > 0 ? getSelection().getRangeAt(0) : undefined
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.addToDatabase,
|
label: window.siyuan.languages.addToDatabase,
|
||||||
accelerator: window.siyuan.config.keymap.general.addToDatabase.custom,
|
accelerator: window.siyuan.config.keymap.general.addToDatabase.custom,
|
||||||
@ -68,6 +70,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
|
focusByRange(range);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
Loading…
Reference in New Issue
Block a user