mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-12 18:24:21 +01:00
This commit is contained in:
parent
b4bcae49f2
commit
b2e021e09b
1 changed files with 13 additions and 11 deletions
|
|
@ -477,17 +477,19 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
||||||
bgFade(focusElement);
|
bgFade(focusElement);
|
||||||
}
|
}
|
||||||
if (action.includes(Constants.CB_GET_FOCUS) || action.includes(Constants.CB_GET_FOCUSFIRST)) {
|
if (action.includes(Constants.CB_GET_FOCUS) || action.includes(Constants.CB_GET_FOCUSFIRST)) {
|
||||||
let range: Range;
|
setTimeout(() => {
|
||||||
if (scrollAttr && scrollAttr.focusId) {
|
let range: Range;
|
||||||
range = focusByOffset(focusElement, scrollAttr.focusStart, scrollAttr.focusEnd) as Range;
|
if (scrollAttr && scrollAttr.focusId) {
|
||||||
} else {
|
range = focusByOffset(focusElement, scrollAttr.focusStart, scrollAttr.focusEnd) as Range;
|
||||||
focusBlock(focusElement, undefined, action.includes(Constants.CB_GET_OUTLINE) ? false : true);
|
} else {
|
||||||
}
|
focusBlock(focusElement, undefined, action.includes(Constants.CB_GET_OUTLINE) ? false : true);
|
||||||
/// #if !MOBILE
|
}
|
||||||
if (!action.includes(Constants.CB_GET_UNUNDO)) {
|
/// #if !MOBILE
|
||||||
pushBack(protyle, range, focusElement);
|
if (!action.includes(Constants.CB_GET_UNUNDO)) {
|
||||||
}
|
pushBack(protyle, range, focusElement);
|
||||||
/// #endif
|
}
|
||||||
|
/// #endif
|
||||||
|
}, focusElement.getAttribute("data-type") === "NodeCodeBlock" ? Constants.TIMEOUT_TRANSITION : 0);
|
||||||
}
|
}
|
||||||
const hasScrollTop = scrollAttr && typeof scrollAttr.scrollTop === "number";
|
const hasScrollTop = scrollAttr && typeof scrollAttr.scrollTop === "number";
|
||||||
if (hasScrollTop) {
|
if (hasScrollTop) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue