diff --git a/gui/app/components/document/document-toc.js b/gui/app/components/document/document-toc.js index ad7b9425..89d2f56a 100644 --- a/gui/app/components/document/document-toc.js +++ b/gui/app/components/document/document-toc.js @@ -250,7 +250,8 @@ export default Component.extend({ onEntryClick(id) { if (id !== '') { let jumpTo = "#page-" + id; - + this.set('tab', 'content'); + if (!$(jumpTo).inView()) { $(jumpTo).velocity("scroll", { duration: 250, offset: -100 }); } diff --git a/gui/app/components/document/page-heading.js b/gui/app/components/document/page-heading.js index 22dbea43..78cc49d4 100644 --- a/gui/app/components/document/page-heading.js +++ b/gui/app/components/document/page-heading.js @@ -102,7 +102,6 @@ export default Component.extend(ModalMixin, { this.attrs.onSavePageAsBlock(block); - this.set('menuOpen', false); this.set('blockTitle', ''); this.set('blockExcerpt', ''); $(titleElem).removeClass('is-invalid'); diff --git a/gui/app/components/document/view-content.js b/gui/app/components/document/view-content.js index d2650de7..269af626 100644 --- a/gui/app/components/document/view-content.js +++ b/gui/app/components/document/view-content.js @@ -43,7 +43,9 @@ export default Component.extend(TooltipMixin, { this._super(...arguments); this.setupAddWizard(); - this.attrs.onGotoPage(this.get('pageId')); + if (this.attrs.onGotoPage !== null) { + this.attrs.onGotoPage(this.get('pageId')); + } this.renderTooltips(); }, diff --git a/gui/app/pods/document/index/controller.js b/gui/app/pods/document/index/controller.js index 9d507467..eea3a626 100644 --- a/gui/app/pods/document/index/controller.js +++ b/gui/app/pods/document/index/controller.js @@ -204,6 +204,7 @@ export default Controller.extend(TooltipMixin, { onGotoPage(id) { if (id !== '') { this.set('pageId', id); + this.set('tab', 'content'); let jumpTo = "#page-" + id; if (!$(jumpTo).inView()) { diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index d4b4f1eb..72d4893e 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -15,7 +15,7 @@