mirror of
https://github.com/documize/community.git
synced 2025-07-23 23:29:42 +02:00
include selected sidebar tab in url query params
This commit is contained in:
parent
91cf0d15ae
commit
891f0ccd18
4 changed files with 14 additions and 10 deletions
|
@ -30,13 +30,13 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
name: "",
|
name: "",
|
||||||
description: ""
|
description: ""
|
||||||
},
|
},
|
||||||
currentTab: '',
|
tab: '',
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
if (is.empty(this.get('currentTab'))) {
|
if (is.empty(this.get('tab'))) {
|
||||||
this.set('currentTab', 'attachments');
|
this.set('tab', 'attachments');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onChangeTab(tab) {
|
onChangeTab(tab) {
|
||||||
this.set('currentTab', tab);
|
this.set('tab', tab);
|
||||||
},
|
},
|
||||||
|
|
||||||
onTagChange(tags) {
|
onTagChange(tags) {
|
||||||
|
|
|
@ -20,11 +20,15 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageId: {
|
pageId: {
|
||||||
refreshModel: true
|
refreshModel: true
|
||||||
|
},
|
||||||
|
tab: {
|
||||||
|
refreshModel: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeModel(transition) {
|
beforeModel(transition) {
|
||||||
this.set('pageId', is.not.undefined(transition.queryParams.pageId) ? transition.queryParams.pageId : '');
|
this.set('pageId', is.not.undefined(transition.queryParams.pageId) ? transition.queryParams.pageId : '');
|
||||||
|
this.set('tab', is.not.undefined(transition.queryParams.tab) ? transition.queryParams.tab : '');
|
||||||
},
|
},
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<div id="sidebar-wrapper">
|
<div id="sidebar-wrapper">
|
||||||
{{document/sidebar-zone folders=model.folders folder=model.folder document=model.document
|
{{document/sidebar-zone folders=model.folders folder=model.folder document=model.document
|
||||||
pages=model.pages sections=model.section links=model.links isEditor=model.isEditor
|
pages=model.pages sections=model.section links=model.links isEditor=model.isEditor tab=tab
|
||||||
onDocumentDelete=(action 'onDocumentDelete') onSaveTemplate=(action 'onSaveTemplate')}}
|
onDocumentDelete=(action 'onDocumentDelete') onSaveTemplate=(action 'onSaveTemplate')}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
<i class="material-icons color-gray">more_horiz</i>
|
<i class="material-icons color-gray">more_horiz</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="margin-top-20"></div>
|
<div class="margin-top-20"></div>
|
||||||
<div class="round-button-mono {{if (is-equal currentTab 'index') 'selected'}}" {{action 'onChangeTab' 'index'}}>
|
<div class="round-button-mono {{if (is-equal tab 'index') 'selected'}}" {{action 'onChangeTab' 'index'}}>
|
||||||
<i class="material-icons">view_headline</i>
|
<i class="material-icons">view_headline</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="margin-top-20"></div>
|
<div class="margin-top-20"></div>
|
||||||
<div class="round-button-mono {{if (is-equal currentTab 'attachments') 'selected'}}" {{action 'onChangeTab' 'attachments'}}>
|
<div class="round-button-mono {{if (is-equal tab 'attachments') 'selected'}}" {{action 'onChangeTab' 'attachments'}}>
|
||||||
<i class="material-icons">attach_file</i>
|
<i class="material-icons">attach_file</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="margin-top-20"></div>
|
<div class="margin-top-20"></div>
|
||||||
<div class="round-button-mono {{if (is-equal currentTab 'activity') 'selected'}}" {{action 'onChangeTab' 'activity'}}>
|
<div class="round-button-mono {{if (is-equal tab 'activity') 'selected'}}" {{action 'onChangeTab' 'activity'}}>
|
||||||
<i class="material-icons">timeline</i>
|
<i class="material-icons">timeline</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="margin-top-20"></div>
|
<div class="margin-top-20"></div>
|
||||||
|
@ -36,11 +36,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="document-sidebar-wrapper">
|
<div class="document-sidebar-wrapper">
|
||||||
{{#if (is-equal currentTab 'attachments')}}
|
{{#if (is-equal tab 'attachments')}}
|
||||||
{{document/sidebar-view-attachments document=document isEditor=isEditor}}
|
{{document/sidebar-view-attachments document=document isEditor=isEditor}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (is-equal currentTab 'activity')}}
|
{{#if (is-equal tab 'activity')}}
|
||||||
{{document/sidebar-view-activity document=document pages=pages isEditor=isEditor}}
|
{{document/sidebar-view-activity document=document pages=pages isEditor=isEditor}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue