mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 11:38:06 +01:00
This commit is contained in:
parent
65d677984f
commit
57d2cd14f0
2 changed files with 12 additions and 6 deletions
|
|
@ -78,7 +78,7 @@ export class Scroll {
|
|||
});
|
||||
}
|
||||
|
||||
public updateIndex(protyle: IProtyle, id: string) {
|
||||
public updateIndex(protyle: IProtyle, id: string, cb?:(index: number) => void) {
|
||||
fetchPost("/api/block/getBlockIndex", {id}, (response) => {
|
||||
if (!response.data) {
|
||||
return;
|
||||
|
|
@ -86,6 +86,9 @@ export class Scroll {
|
|||
const inputElement = protyle.scroll.element.querySelector(".b3-slider") as HTMLInputElement;
|
||||
inputElement.value = response.data;
|
||||
protyle.scroll.element.setAttribute("aria-label", `Blocks ${response.data}/${protyle.block.blockCount}`);
|
||||
if (cb) {
|
||||
cb(response.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue