mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
Scroll to correct point in document for edit mode
This commit is contained in:
parent
c0d70e38de
commit
412127811e
9 changed files with 35 additions and 16 deletions
|
@ -53,6 +53,8 @@ export default Component.extend(TooltipMixin, {
|
|||
this.setupAddWizard();
|
||||
this.renderTooltips();
|
||||
}
|
||||
|
||||
this.jumpToSection();
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
|
@ -80,7 +82,9 @@ export default Component.extend(TooltipMixin, {
|
|||
link.orphan = true;
|
||||
} else {
|
||||
if (link.linkType === "section") {
|
||||
this.get('browser').scrollTo(`#page-${link.targetId}`);
|
||||
self.get('currentPageId', link.targetId)
|
||||
self.jumpToSection();
|
||||
// self.get('browser').scrollTo(`#page-${link.targetId}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,6 +151,13 @@ export default Component.extend(TooltipMixin, {
|
|||
return this.get('onInsertSection')(model);
|
||||
},
|
||||
|
||||
jumpToSection() {
|
||||
let cp = this.get('currentPageId');
|
||||
if (is.not.empty(cp) && is.not.undefined(cp) && is.not.null(cp)) {
|
||||
this.get('browser').scrollTo(`#page-${cp}`)
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSavePageAsBlock(block) {
|
||||
let cb = this.get('onSavePageAsBlock');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue