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:
parent
44970a7861
commit
8b05e7ab81
8 changed files with 16 additions and 8 deletions
|
@ -250,6 +250,7 @@ export default Component.extend({
|
||||||
onEntryClick(id) {
|
onEntryClick(id) {
|
||||||
if (id !== '') {
|
if (id !== '') {
|
||||||
let jumpTo = "#page-" + id;
|
let jumpTo = "#page-" + id;
|
||||||
|
this.set('tab', 'content');
|
||||||
|
|
||||||
if (!$(jumpTo).inView()) {
|
if (!$(jumpTo).inView()) {
|
||||||
$(jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
$(jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
||||||
|
|
|
@ -102,7 +102,6 @@ export default Component.extend(ModalMixin, {
|
||||||
|
|
||||||
this.attrs.onSavePageAsBlock(block);
|
this.attrs.onSavePageAsBlock(block);
|
||||||
|
|
||||||
this.set('menuOpen', false);
|
|
||||||
this.set('blockTitle', '');
|
this.set('blockTitle', '');
|
||||||
this.set('blockExcerpt', '');
|
this.set('blockExcerpt', '');
|
||||||
$(titleElem).removeClass('is-invalid');
|
$(titleElem).removeClass('is-invalid');
|
||||||
|
|
|
@ -43,7 +43,9 @@ export default Component.extend(TooltipMixin, {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.setupAddWizard();
|
this.setupAddWizard();
|
||||||
|
|
||||||
|
if (this.attrs.onGotoPage !== null) {
|
||||||
this.attrs.onGotoPage(this.get('pageId'));
|
this.attrs.onGotoPage(this.get('pageId'));
|
||||||
|
}
|
||||||
|
|
||||||
this.renderTooltips();
|
this.renderTooltips();
|
||||||
},
|
},
|
||||||
|
|
|
@ -204,6 +204,7 @@ export default Controller.extend(TooltipMixin, {
|
||||||
onGotoPage(id) {
|
onGotoPage(id) {
|
||||||
if (id !== '') {
|
if (id !== '') {
|
||||||
this.set('pageId', id);
|
this.set('pageId', id);
|
||||||
|
this.set('tab', 'content');
|
||||||
|
|
||||||
let jumpTo = "#page-" + id;
|
let jumpTo = "#page-" + id;
|
||||||
if (!$(jumpTo).inView()) {
|
if (!$(jumpTo).inView()) {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<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')}}
|
onPageSequenceChange=(action 'onPageSequenceChange') onPageLevelChange=(action 'onPageLevelChange') onGotoPage=(action 'onGotoPage')}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,8 +26,10 @@
|
||||||
<ul class="tabnav-control">
|
<ul class="tabnav-control">
|
||||||
<li class="tab {{if (eq tab 'content') 'selected'}}" {{action 'onTabChange' 'content'}}>Content</li>
|
<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>
|
<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 'activity') 'selected'}}" {{action 'onTabChange' 'activity'}}>Activity</li>
|
||||||
<li class="tab {{if (eq tab 'revision') 'selected'}}" {{action 'onTabChange' 'revision'}}>Revisions</li>
|
<li class="tab {{if (eq tab 'revision') 'selected'}}" {{action 'onTabChange' 'revision'}}>Revisions</li>
|
||||||
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
import { Promise as EmberPromise, hash } from 'rsvp';
|
import { Promise as EmberPromise, hash } from 'rsvp';
|
||||||
|
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import Route from '@ember/routing/route';
|
import Route from '@ember/routing/route';
|
||||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||||
|
|
|
@ -24,3 +24,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.section-divider {
|
||||||
|
margin-top: 70px;
|
||||||
|
}
|
|
@ -17,8 +17,8 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
list-style-type: none;
|
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-left: -4px; // remove whitespace inline block
|
||||||
|
margin-top: -1px; // ensure no double-border when tabs are stacked vertically on mobile device
|
||||||
|
|
||||||
&:first-of-type {
|
&:first-of-type {
|
||||||
@include border-radius-left(3px);
|
@include border-radius-left(3px);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue