mirror of
https://github.com/documize/community.git
synced 2025-08-02 12:05:23 +02:00
Closes #95 -- flat and section style document viewing
This commit is contained in:
parent
ef6b7f429c
commit
4a2147189a
8 changed files with 52 additions and 9 deletions
|
@ -16,6 +16,7 @@ import NotifierMixin from '../../mixins/notifier';
|
|||
export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
sectionService: Ember.inject.service('section'),
|
||||
sessionService: Ember.inject.service('session'),
|
||||
appMeta: Ember.inject.service(),
|
||||
userService: Ember.inject.service('user'),
|
||||
localStorage: Ember.inject.service(),
|
||||
|
@ -138,6 +139,14 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
|||
this.showNotification('Template saved');
|
||||
this.attrs.onSaveTemplate(name, excerpt);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onLayoutChange(layout) {
|
||||
let doc = this.get('document');
|
||||
doc.set('layout', layout);
|
||||
this.get('documentService').save(doc);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ export default Model.extend({
|
|||
userId: attr('string'),
|
||||
tags: attr('string'),
|
||||
template: attr('boolean'),
|
||||
layout: attr('string'),
|
||||
|
||||
// client-side property
|
||||
selected: attr('boolean', { defaultValue: false }),
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
@include content-container();
|
||||
@include ease-in();
|
||||
@extend .transition-all;
|
||||
overflow-x: scroll;
|
||||
overflow-x: auto;
|
||||
|
||||
&:hover {
|
||||
.page-title {
|
||||
|
@ -329,6 +329,28 @@
|
|||
}
|
||||
}
|
||||
|
||||
.document-view-unified {
|
||||
margin: 0 0 50px 0;
|
||||
@include content-container();
|
||||
@include ease-in();
|
||||
@extend .transition-all;
|
||||
|
||||
.is-a-page, .is-a-tab {
|
||||
padding: 0 !important;
|
||||
box-shadow: none !important;
|
||||
background-color: transparent !important;
|
||||
@include border-radius(0px);
|
||||
}
|
||||
|
||||
.tab-min, .tab-max {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.start-section {
|
||||
height: 50px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-page-toolbar {
|
||||
width: 300px;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="document-view">
|
||||
<div class="document-view {{if (is-equal document.layout 'doc') 'document-view-unified'}}">
|
||||
|
||||
{{#if hasPages}}
|
||||
{{#each pages key="id" as |page index|}}
|
||||
|
|
|
@ -43,6 +43,13 @@
|
|||
{{#dropdown-menu target="sidebar-zone-more-button" position="bottom left" open="click" onOpenCallback=(action 'onMenuOpen') onCloseCallback=(action 'onMenuOpen')}}
|
||||
<ul class="menu">
|
||||
{{#if session.authenticated}}
|
||||
{{#if (is-equal document.layout 'section')}}
|
||||
<li class="item" {{action 'onLayoutChange' 'doc'}}>Flat view</li>
|
||||
<li class="divider"></li>
|
||||
{{else}}
|
||||
<li class="item" {{action 'onLayoutChange' 'section'}}>Section view</li>
|
||||
<li class="divider"></li>
|
||||
{{/if}}
|
||||
{{#if pinState.isPinned}}
|
||||
<li class="item" {{action 'onUnpin'}}>Unpin</li>
|
||||
{{else}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue