This commit is contained in:
parent
580209b165
commit
0606ee127e
2 changed files with 14 additions and 3 deletions
|
@ -158,7 +158,7 @@ const mergePluginHotkey = (plugin: Plugin) => {
|
|||
}
|
||||
window.siyuan.config.keymap.plugin[plugin.name][dockKey]["default"] = dock.config.hotkey;
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
export const afterLoadPlugin = (plugin: Plugin) => {
|
||||
|
@ -222,7 +222,7 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
|||
});
|
||||
Object.keys(plugin.docks).forEach(key => {
|
||||
const dock = plugin.docks[key];
|
||||
const hotkey = window.siyuan.config.keymap.plugin[plugin.name][key].custom
|
||||
const hotkey = window.siyuan.config.keymap.plugin[plugin.name][key].custom;
|
||||
if (dock.config.position.startsWith("Left")) {
|
||||
window.siyuan.layout.leftDock.genButton([{
|
||||
type: key,
|
||||
|
|
|
@ -875,11 +875,17 @@ export class WYSIWYG {
|
|||
return;
|
||||
}
|
||||
let firstBlockElement = hasClosestBlock(firstElement);
|
||||
if (!firstBlockElement && firstElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||
firstBlockElement = firstElement.nextElementSibling as HTMLElement;
|
||||
}
|
||||
if (moveEvent.clientY > y) {
|
||||
if (!startFirstElement) {
|
||||
// 向上选择导致滚动条滚动到顶部再向下选择至 > y 时,firstBlockElement 为 undefined https://ld246.com/article/1705233964097
|
||||
if (!firstBlockElement) {
|
||||
firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
|
||||
if (firstBlockElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||
firstBlockElement = firstBlockElement.nextElementSibling as HTMLElement;
|
||||
}
|
||||
}
|
||||
startFirstElement = firstBlockElement;
|
||||
}
|
||||
|
@ -887,6 +893,9 @@ export class WYSIWYG {
|
|||
// https://github.com/siyuan-note/siyuan/issues/7580
|
||||
moveEvent.clientY < protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().bottom) {
|
||||
firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
|
||||
if (firstBlockElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||
firstBlockElement = firstBlockElement.nextElementSibling as HTMLElement;
|
||||
}
|
||||
}
|
||||
let selectElements: Element[] = [];
|
||||
let currentElement: Element | boolean = firstBlockElement;
|
||||
|
@ -915,7 +924,9 @@ export class WYSIWYG {
|
|||
hasJump = true;
|
||||
}
|
||||
} else {
|
||||
selectElements.push(currentElement);
|
||||
if (!currentElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||
selectElements.push(currentElement);
|
||||
}
|
||||
currentElement = currentElement.nextElementSibling;
|
||||
}
|
||||
} else if (currentElement.parentElement.classList.contains("sb")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue