Skip to content

Commit ae50b88

Browse files
committed
Jump scroll to section for internal links
1 parent 6ff74cf commit ae50b88

File tree

2 files changed

+667
-670
lines changed

2 files changed

+667
-670
lines changed

embed/bindata.go

Lines changed: 664 additions & 664 deletions
Large diffs are not rendered by default.

gui/app/components/document/view-content.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default Component.extend(TooltipMixin, Notifier, {
5353
this.renderTooltips();
5454
}
5555

56-
this.jumpToSection();
56+
this.jumpToSection(this.get('currentPageId'));
5757
},
5858

5959
willDestroyElement() {
@@ -80,9 +80,7 @@ export default Component.extend(TooltipMixin, Notifier, {
8080
link.orphan = true;
8181
} else {
8282
if (link.linkType === "section") {
83-
self.get('currentPageId', link.targetId)
84-
self.jumpToSection();
85-
// self.get('browser').scrollTo(`#page-${link.targetId}`);
83+
self.jumpToSection(link.targetId);
8684
}
8785
}
8886
}
@@ -99,8 +97,7 @@ export default Component.extend(TooltipMixin, Notifier, {
9997
});
10098
},
10199

102-
jumpToSection() {
103-
let cp = this.get('currentPageId');
100+
jumpToSection(cp) {
104101
if (is.not.empty(cp) && is.not.undefined(cp) && is.not.null(cp)) {
105102
this.get('browser').scrollTo(`#page-${cp}`)
106103
}

0 commit comments

Comments
 (0)