1
0
Fork 0
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:
HarveyKandola 2018-06-22 12:44:20 +01:00
parent 6ff74cf45e
commit ae50b889c5
2 changed files with 674 additions and 677 deletions

File diff suppressed because one or more lines are too long

View file

@ -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}`)
}