diff --git a/app/app/components/document/document-sidebar-close-action.js b/app/app/components/document/document-sidebar-close-action.js new file mode 100644 index 00000000..172a15f1 --- /dev/null +++ b/app/app/components/document/document-sidebar-close-action.js @@ -0,0 +1,20 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +export default Ember.Component.extend({ + actions: { + close() { + this.attrs.close(); + } + } +}); diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index 39a967ed..0c1107b1 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -14,9 +14,11 @@ import TooltipMixin from '../../mixins/tooltip'; export default Ember.Component.extend(TooltipMixin, { documentService: Ember.inject.service('document'), - document: {}, folder: {}, + showToc: true, + showViews: false, + showContributions: false, didRender() { if (this.session.authenticated) { @@ -46,6 +48,24 @@ export default Ember.Component.extend(TooltipMixin, { // close dialog close() { return true; - } + }, + + showToc() { + this.set('showToc', true); + this.set('showViews', false); + this.set('showContributions', false); + }, + + showViews() { + this.set('showToc', false); + this.set('showViews', true); + this.set('showContributions', false); + }, + + showContributions() { + this.set('showToc', false); + this.set('showViews', false); + this.set('showContributions', true); + } } }); diff --git a/app/app/styles/view/document/sidebar.scss b/app/app/styles/view/document/sidebar.scss index 1be28d1f..5b967c88 100644 --- a/app/app/styles/view/document/sidebar.scss +++ b/app/app/styles/view/document/sidebar.scss @@ -3,7 +3,7 @@ > .summary-line { color: $color-gray; - margin-top: 20px; + margin: 20px 0 30px 0; >.items { padding: 0; @@ -51,11 +51,23 @@ top: 10px; } + .close-action { + float: right; + + > .round-button-mono { + color: $color-stroke; + border-color: $color-stroke; + + > .material-icons { + color: $color-stroke; + } + } + } + .document-structure { > .toc-controls { text-align: center; margin: 0; - padding: 30px 0 10px 0; color: $color-gray; > .round-button-mono { @@ -84,6 +96,7 @@ font-size: 13px; overflow-x: hidden; list-style-type: none; + margin: 20px 0 0 0; .item { padding: 4px 0; @@ -110,17 +123,10 @@ } .meta-viewers { - overflow-y: auto; - overflow-x: hidden; - > .items { list-style-type: none; margin: 0; padding: 0; - overflow-y: auto; - overflow-x: hidden; - height: 300px; - min-width: 300px; white-space: nowrap; > .item { @@ -159,10 +165,6 @@ list-style-type: none; margin: 0; padding: 0; - overflow-y: auto; - overflow-x: hidden; - height: 300px; - min-width: 300px; white-space: nowrap; > .item { diff --git a/app/app/templates/components/document/document-sidebar-close-action.hbs b/app/app/templates/components/document/document-sidebar-close-action.hbs new file mode 100644 index 00000000..b27ae2a4 --- /dev/null +++ b/app/app/templates/components/document/document-sidebar-close-action.hbs @@ -0,0 +1,6 @@ +
+
+ clear +
+
+
diff --git a/app/app/templates/components/document/document-sidebar.hbs b/app/app/templates/components/document/document-sidebar.hbs index 3e01a8ee..23eb0a0f 100644 --- a/app/app/templates/components/document/document-sidebar.hbs +++ b/app/app/templates/components/document/document-sidebar.hbs @@ -6,14 +6,14 @@
{{owner.initials}}
  • -
  • +
  • {{meta.viewers.length}}
    views
  • -
  • +
  • {{meta.editors.length}}
    activity
    @@ -21,16 +21,21 @@
  • - {{#dropdown-dialog target="meta-button-viewers" position="bottom left" showCancel=false button="Close" onAction=(action 'close') color="flat-gray"}} - {{document/document-sidebar-viewers meta=meta}} - {{/dropdown-dialog}} - {{#dropdown-dialog target="meta-button-history" position="bottom left" showCancel=false button="Close" onAction=(action 'close') color="flat-gray"}} - {{document/document-sidebar-edits pages=pages meta=meta}} - {{/dropdown-dialog}} {{else}}
    {{/if}} - {{document/document-sidebar-toc document=model folder=folder pages=pages page=page isEditor=isEditor - changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') - gotoPage=(action 'gotoPage')}} + + {{#if showToc}} + {{document/document-sidebar-toc document=model folder=folder pages=pages page=page isEditor=isEditor + changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') + gotoPage=(action 'gotoPage')}} + {{/if}} + {{#if showViews}} + {{document/document-sidebar-close-action close=(action 'showToc')}} + {{document/document-sidebar-viewers meta=meta}} + {{/if}} + {{#if showContributions}} + {{document/document-sidebar-close-action close=(action 'showToc')}} + {{document/document-sidebar-edits pages=pages meta=meta}} + {{/if}}