1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 06:39:43 +02:00

switch to doc content view when clicking on TOC entry

This commit is contained in:
Harvey Kandola 2017-12-19 14:00:53 +00:00
parent 44970a7861
commit 8b05e7ab81
8 changed files with 16 additions and 8 deletions

View file

@ -250,6 +250,7 @@ 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 });

View file

@ -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');

View file

@ -43,7 +43,9 @@ export default Component.extend(TooltipMixin, {
this._super(...arguments);
this.setupAddWizard();
if (this.attrs.onGotoPage !== null) {
this.attrs.onGotoPage(this.get('pageId'));
}
this.renderTooltips();
},

View file

@ -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()) {

View file

@ -15,7 +15,7 @@
</div>
<div class="row">
<div class="col-12">
{{document/document-toc document=document folder=folder pages=pages page=page permissions=permissions currentPageId=pageId
{{document/document-toc document=document folder=folder pages=pages page=page permissions=permissions currentPageId=pageId tab=tab
onPageSequenceChange=(action 'onPageSequenceChange') onPageLevelChange=(action 'onPageLevelChange') onGotoPage=(action 'onGotoPage')}}
</div>
</div>
@ -26,8 +26,10 @@
<ul class="tabnav-control">
<li class="tab {{if (eq tab 'content') 'selected'}}" {{action 'onTabChange' 'content'}}>Content</li>
<li class="tab {{if (eq tab 'attachment') 'selected'}}" {{action 'onTabChange' 'attachment'}}>Attachments</li>
{{#if session.authenticated}}
<li class="tab {{if (eq tab 'activity') 'selected'}}" {{action 'onTabChange' 'activity'}}>Activity</li>
<li class="tab {{if (eq tab 'revision') 'selected'}}" {{action 'onTabChange' 'revision'}}>Revisions</li>
{{/if}}
</ul>
</div>

View file

@ -10,7 +10,6 @@
// https://documize.com
import { Promise as EmberPromise, hash } from 'rsvp';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

View file

@ -24,3 +24,7 @@
}
}
}
.section-divider {
margin-top: 70px;
}

View file

@ -17,8 +17,8 @@
cursor: pointer;
line-height: 26px;
list-style-type: none;
// margin: -1px 0 0 -5px; // handles border overlap when tabs wrap onto 2nd line
margin-left: -4px; // remove whitespace inline block
margin-top: -1px; // ensure no double-border when tabs are stacked vertically on mobile device
&:first-of-type {
@include border-radius-left(3px);