mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
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;
|
window.siyuan.config.keymap.plugin[plugin.name][dockKey]["default"] = dock.config.hotkey;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const afterLoadPlugin = (plugin: Plugin) => {
|
export const afterLoadPlugin = (plugin: Plugin) => {
|
||||||
|
|
@ -222,7 +222,7 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
||||||
});
|
});
|
||||||
Object.keys(plugin.docks).forEach(key => {
|
Object.keys(plugin.docks).forEach(key => {
|
||||||
const dock = plugin.docks[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")) {
|
if (dock.config.position.startsWith("Left")) {
|
||||||
window.siyuan.layout.leftDock.genButton([{
|
window.siyuan.layout.leftDock.genButton([{
|
||||||
type: key,
|
type: key,
|
||||||
|
|
|
||||||
|
|
@ -875,11 +875,17 @@ export class WYSIWYG {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let firstBlockElement = hasClosestBlock(firstElement);
|
let firstBlockElement = hasClosestBlock(firstElement);
|
||||||
|
if (!firstBlockElement && firstElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||||
|
firstBlockElement = firstElement.nextElementSibling as HTMLElement;
|
||||||
|
}
|
||||||
if (moveEvent.clientY > y) {
|
if (moveEvent.clientY > y) {
|
||||||
if (!startFirstElement) {
|
if (!startFirstElement) {
|
||||||
// 向上选择导致滚动条滚动到顶部再向下选择至 > y 时,firstBlockElement 为 undefined https://ld246.com/article/1705233964097
|
// 向上选择导致滚动条滚动到顶部再向下选择至 > y 时,firstBlockElement 为 undefined https://ld246.com/article/1705233964097
|
||||||
if (!firstBlockElement) {
|
if (!firstBlockElement) {
|
||||||
firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
|
firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
|
||||||
|
if (firstBlockElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||||
|
firstBlockElement = firstBlockElement.nextElementSibling as HTMLElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
startFirstElement = firstBlockElement;
|
startFirstElement = firstBlockElement;
|
||||||
}
|
}
|
||||||
|
|
@ -887,6 +893,9 @@ export class WYSIWYG {
|
||||||
// https://github.com/siyuan-note/siyuan/issues/7580
|
// https://github.com/siyuan-note/siyuan/issues/7580
|
||||||
moveEvent.clientY < protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().bottom) {
|
moveEvent.clientY < protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().bottom) {
|
||||||
firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
|
firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
|
||||||
|
if (firstBlockElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||||
|
firstBlockElement = firstBlockElement.nextElementSibling as HTMLElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let selectElements: Element[] = [];
|
let selectElements: Element[] = [];
|
||||||
let currentElement: Element | boolean = firstBlockElement;
|
let currentElement: Element | boolean = firstBlockElement;
|
||||||
|
|
@ -915,7 +924,9 @@ export class WYSIWYG {
|
||||||
hasJump = true;
|
hasJump = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!currentElement.classList.contains("protyle-breadcrumb__bar")) {
|
||||||
selectElements.push(currentElement);
|
selectElements.push(currentElement);
|
||||||
|
}
|
||||||
currentElement = currentElement.nextElementSibling;
|
currentElement = currentElement.nextElementSibling;
|
||||||
}
|
}
|
||||||
} else if (currentElement.parentElement.classList.contains("sb")) {
|
} else if (currentElement.parentElement.classList.contains("sb")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue