@tekkare/auriga 0.1.133 → 0.1.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -86,8 +86,8 @@ export default defineComponent({
|
|
|
86
86
|
});
|
|
87
87
|
} else {
|
|
88
88
|
scrollChapters();
|
|
89
|
-
document.addEventListener("scroll", scrollChapters);
|
|
90
89
|
}
|
|
90
|
+
document.addEventListener("scroll", scrollChapters);
|
|
91
91
|
});
|
|
92
92
|
function scrollChapters() {
|
|
93
93
|
getChaptersInPage.value.forEach((elem) => {
|
|
@@ -112,25 +112,14 @@ export default defineComponent({
|
|
|
112
112
|
const rect = element.getBoundingClientRect();
|
|
113
113
|
return rect.top <= getElementPosition("chapter_menu") + 10;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
window.scrollTo({ top: targetPosition, behavior: "smooth" });
|
|
124
|
-
}
|
|
125
|
-
resolve();
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
async function selectChapter(index, anchorId) {
|
|
129
|
-
await removeEvent(index, anchorId).then(() => {
|
|
130
|
-
setTimeout(() => {
|
|
131
|
-
document.addEventListener("scroll", scrollChapters);
|
|
132
|
-
}, 1200);
|
|
133
|
-
});
|
|
115
|
+
function selectChapter(index, anchorId) {
|
|
116
|
+
activeChapter.value = index;
|
|
117
|
+
setBarPosition();
|
|
118
|
+
const targetElement = document.getElementById(anchorId);
|
|
119
|
+
if (targetElement) {
|
|
120
|
+
const targetPosition = targetElement.offsetTop - headerHeight.value;
|
|
121
|
+
window.scrollTo({ top: targetPosition, behavior: "smooth" });
|
|
122
|
+
}
|
|
134
123
|
}
|
|
135
124
|
function setBarPosition() {
|
|
136
125
|
const selector = document?.getElementById(`chapters_nav_bar`);
|
|
@@ -17,7 +17,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
17
|
value: null;
|
|
18
18
|
};
|
|
19
19
|
}, {
|
|
20
|
-
selectChapter: (index: number, anchorId: string) =>
|
|
20
|
+
selectChapter: (index: number, anchorId: string) => void;
|
|
21
21
|
activeChapter: import("vue").Ref<any>;
|
|
22
22
|
headerHeight: import("vue").Ref<number>;
|
|
23
23
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|