mirror of
https://github.com/documize/community.git
synced 2025-08-08 15:05:28 +02:00
Fixes and cleanup
This commit is contained in:
parent
f41517872b
commit
8597dc3dca
5 changed files with 170 additions and 169 deletions
|
@ -16,6 +16,7 @@ import TooltipMixin from '../../mixins/tooltip';
|
|||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
sectionService: Ember.inject.service('section'),
|
||||
appMeta: Ember.inject.service(),
|
||||
/* Parameters */
|
||||
document: null,
|
||||
// pages: [],
|
||||
|
@ -35,15 +36,15 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
children: false
|
||||
},
|
||||
|
||||
noSections: Ember.computed('pages', function() {
|
||||
noSections: Ember.computed('pages', function () {
|
||||
return this.get('pages.length') === 0;
|
||||
}),
|
||||
|
||||
didInsertElement() {
|
||||
let self = this;
|
||||
|
||||
this.get('sectionService').refresh(this.get('document.id')).then(function(changes) {
|
||||
changes.forEach(function(newPage) {
|
||||
this.get('sectionService').refresh(this.get('document.id')).then(function (changes) {
|
||||
changes.forEach(function (newPage) {
|
||||
let oldPage = self.get('pages').findBy('id', newPage.get('id'));
|
||||
if (is.not.undefined(oldPage)) {
|
||||
oldPage.set('body', newPage.body);
|
||||
|
|
|
@ -2,15 +2,15 @@ import Ember from 'ember';
|
|||
|
||||
export default Ember.Service.extend({
|
||||
|
||||
storeSessionItem: function(key, data) {
|
||||
storeSessionItem: function (key, data) {
|
||||
localStorage[key] = data;
|
||||
},
|
||||
|
||||
getSessionItem: function(key) {
|
||||
getSessionItem: function (key) {
|
||||
return localStorage[key];
|
||||
},
|
||||
|
||||
clearSessionItem: function(key) {
|
||||
clearSessionItem: function (key) {
|
||||
delete localStorage[key];
|
||||
}
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{{#each attachments key="id" as |a index|}}
|
||||
<li class="item">
|
||||
<img class="icon" src="assets/img/attachments/{{document/file-icon a.extension}}" />
|
||||
<a href="{{ session.appMeta.apiUrl }}api/public/attachments/{{ session.appMeta.orgId }}/{{ a.job }}/{{ a.fileId }}">
|
||||
<a href="{{ appMeta.apiUrl }}api/public/attachments/{{ appMeta.orgId }}/{{ a.job }}/{{ a.fileId }}">
|
||||
<span class="file">{{ a.filename }}</span>
|
||||
</a>
|
||||
{{#if isEditor}}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
</div>
|
||||
{{else}}
|
||||
{{#link-to 'application' class='title'}}
|
||||
<div class="header-button" title=session.appMeta.title>
|
||||
<div class="header-button" title=appMeta.title>
|
||||
<i class="material-icons">apps</i>
|
||||
</div>
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
{{#link-to 'application' class='title'}}
|
||||
{{session.appMeta.title}}
|
||||
{{appMeta.title}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue