This commit is contained in:
Vanessa 2023-05-16 00:05:18 +08:00
parent 1ac623ebb1
commit d24f5ae3cf
8 changed files with 26 additions and 28 deletions

View file

@ -1,5 +1,5 @@
import {hasClosestBlock} from "../util/hasClosest";
import {focusByOffset, getSelectionOffset} from "../util/selection";
import {getSelectionOffset} from "../util/selection";
import {fetchPost} from "../../util/fetch";
import {onGet} from "../util/onGet";
import {Constants} from "../../constants";
@ -50,12 +50,12 @@ export const getDocByScroll = (options: {
cb?: () => void
focus?: boolean
}) => {
let actions: string[] = []
let actions: string[] = [];
if (options.mergedOptions) {
actions = options.mergedOptions.action
actions = options.mergedOptions.action;
} else {
if (options.focus) {
actions = [Constants.CB_GET_UNUNDO, Constants.CB_GET_FOCUS]
actions = [Constants.CB_GET_UNUNDO, Constants.CB_GET_FOCUS];
} else {
actions = [Constants.CB_GET_UNUNDO];
}
@ -70,7 +70,7 @@ export const getDocByScroll = (options: {
}, response => {
onGet(response, options.protyle, actions, options.scrollAttr);
if (options.cb) {
options.cb()
options.cb();
}
});
}
@ -81,7 +81,7 @@ export const getDocByScroll = (options: {
}, response => {
onGet(response, options.protyle, actions, options.scrollAttr);
if (options.cb) {
options.cb()
options.cb();
}
});
};