mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Jump scroll to section for internal links
This commit is contained in:
parent
6ff74cf45e
commit
ae50b889c5
2 changed files with 674 additions and 677 deletions
1342
embed/bindata.go
1342
embed/bindata.go
File diff suppressed because one or more lines are too long
|
@ -53,7 +53,7 @@ export default Component.extend(TooltipMixin, Notifier, {
|
|||
this.renderTooltips();
|
||||
}
|
||||
|
||||
this.jumpToSection();
|
||||
this.jumpToSection(this.get('currentPageId'));
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
|
@ -80,9 +80,7 @@ export default Component.extend(TooltipMixin, Notifier, {
|
|||
link.orphan = true;
|
||||
} else {
|
||||
if (link.linkType === "section") {
|
||||
self.get('currentPageId', link.targetId)
|
||||
self.jumpToSection();
|
||||
// self.get('browser').scrollTo(`#page-${link.targetId}`);
|
||||
self.jumpToSection(link.targetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,8 +97,7 @@ export default Component.extend(TooltipMixin, Notifier, {
|
|||
});
|
||||
},
|
||||
|
||||
jumpToSection() {
|
||||
let cp = this.get('currentPageId');
|
||||
jumpToSection(cp) {
|
||||
if (is.not.empty(cp) && is.not.undefined(cp) && is.not.null(cp)) {
|
||||
this.get('browser').scrollTo(`#page-${cp}`)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue