@eric-emg/symphiq-components 1.2.108 → 1.2.109
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.
|
@@ -24149,24 +24149,7 @@ class FloatingTocComponent {
|
|
|
24149
24149
|
scrollToSection(sectionId) {
|
|
24150
24150
|
const element = document.getElementById(`section-${sectionId}`);
|
|
24151
24151
|
if (element) {
|
|
24152
|
-
|
|
24153
|
-
const scrollTop = this.scrollElement.scrollTop;
|
|
24154
|
-
const containerRect = this.scrollElement.getBoundingClientRect();
|
|
24155
|
-
const elementRect = element.getBoundingClientRect();
|
|
24156
|
-
const offsetPosition = scrollTop + (elementRect.top - containerRect.top) - this.HEADER_OFFSET - this.parentHeaderOffset;
|
|
24157
|
-
this.scrollElement.scrollTo({
|
|
24158
|
-
top: offsetPosition,
|
|
24159
|
-
behavior: 'smooth'
|
|
24160
|
-
});
|
|
24161
|
-
}
|
|
24162
|
-
else {
|
|
24163
|
-
const elementPosition = element.getBoundingClientRect().top + window.scrollY;
|
|
24164
|
-
const offsetPosition = elementPosition - this.HEADER_OFFSET;
|
|
24165
|
-
window.scrollTo({
|
|
24166
|
-
top: offsetPosition,
|
|
24167
|
-
behavior: 'smooth'
|
|
24168
|
-
});
|
|
24169
|
-
}
|
|
24152
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
24170
24153
|
}
|
|
24171
24154
|
if (!this.isPinned()) {
|
|
24172
24155
|
this.isHovered.set(false);
|
|
@@ -24175,24 +24158,7 @@ class FloatingTocComponent {
|
|
|
24175
24158
|
scrollToSubsection(subsectionId) {
|
|
24176
24159
|
const element = document.getElementById(`subsection-${subsectionId}`);
|
|
24177
24160
|
if (element) {
|
|
24178
|
-
|
|
24179
|
-
const scrollTop = this.scrollElement.scrollTop;
|
|
24180
|
-
const containerRect = this.scrollElement.getBoundingClientRect();
|
|
24181
|
-
const elementRect = element.getBoundingClientRect();
|
|
24182
|
-
const offsetPosition = scrollTop + (elementRect.top - containerRect.top) - this.HEADER_OFFSET - this.parentHeaderOffset;
|
|
24183
|
-
this.scrollElement.scrollTo({
|
|
24184
|
-
top: offsetPosition,
|
|
24185
|
-
behavior: 'smooth'
|
|
24186
|
-
});
|
|
24187
|
-
}
|
|
24188
|
-
else {
|
|
24189
|
-
const elementPosition = element.getBoundingClientRect().top + window.scrollY;
|
|
24190
|
-
const offsetPosition = elementPosition - this.HEADER_OFFSET;
|
|
24191
|
-
window.scrollTo({
|
|
24192
|
-
top: offsetPosition,
|
|
24193
|
-
behavior: 'smooth'
|
|
24194
|
-
});
|
|
24195
|
-
}
|
|
24161
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
24196
24162
|
}
|
|
24197
24163
|
if (!this.isPinned()) {
|
|
24198
24164
|
this.isHovered.set(false);
|