mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +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: "",
|
||||
description: ""
|
||||
},
|
||||
currentTab: '',
|
||||
tab: '',
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (is.empty(this.get('currentTab'))) {
|
||||
this.set('currentTab', 'attachments');
|
||||
if (is.empty(this.get('tab'))) {
|
||||
this.set('tab', 'attachments');
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -65,7 +65,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
|||
|
||||
actions: {
|
||||
onChangeTab(tab) {
|
||||
this.set('currentTab', tab);
|
||||
this.set('tab', tab);
|
||||
},
|
||||
|
||||
onTagChange(tags) {
|
||||
|
|
|
@ -20,11 +20,15 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
queryParams: {
|
||||
pageId: {
|
||||
refreshModel: true
|
||||
},
|
||||
tab: {
|
||||
refreshModel: false
|
||||
}
|
||||
},
|
||||
|
||||
beforeModel(transition) {
|
||||
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() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div id="sidebar-wrapper">
|
||||
{{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')}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
<i class="material-icons color-gray">more_horiz</i>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
<div class="margin-top-20"></div>
|
||||
|
@ -36,11 +36,11 @@
|
|||
</div>
|
||||
|
||||
<div class="document-sidebar-wrapper">
|
||||
{{#if (is-equal currentTab 'attachments')}}
|
||||
{{#if (is-equal tab 'attachments')}}
|
||||
{{document/sidebar-view-attachments document=document isEditor=isEditor}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (is-equal currentTab 'activity')}}
|
||||
{{#if (is-equal tab 'activity')}}
|
||||
{{document/sidebar-view-activity document=document pages=pages isEditor=isEditor}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue