1
0
Fork 0
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:
zinyando 2016-07-07 14:11:35 +02:00
parent f41517872b
commit 8597dc3dca
5 changed files with 170 additions and 169 deletions

View file

@ -16,6 +16,7 @@ import TooltipMixin from '../../mixins/tooltip';
export default Ember.Component.extend(NotifierMixin, TooltipMixin, { export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
documentService: Ember.inject.service('document'), documentService: Ember.inject.service('document'),
sectionService: Ember.inject.service('section'), sectionService: Ember.inject.service('section'),
appMeta: Ember.inject.service(),
/* Parameters */ /* Parameters */
document: null, document: null,
// pages: [], // pages: [],
@ -35,15 +36,15 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
children: false children: false
}, },
noSections: Ember.computed('pages', function() { noSections: Ember.computed('pages', function () {
return this.get('pages.length') === 0; return this.get('pages.length') === 0;
}), }),
didInsertElement() { didInsertElement() {
let self = this; let self = this;
this.get('sectionService').refresh(this.get('document.id')).then(function(changes) { this.get('sectionService').refresh(this.get('document.id')).then(function (changes) {
changes.forEach(function(newPage) { changes.forEach(function (newPage) {
let oldPage = self.get('pages').findBy('id', newPage.get('id')); let oldPage = self.get('pages').findBy('id', newPage.get('id'));
if (is.not.undefined(oldPage)) { if (is.not.undefined(oldPage)) {
oldPage.set('body', newPage.body); oldPage.set('body', newPage.body);

View file

@ -2,15 +2,15 @@ import Ember from 'ember';
export default Ember.Service.extend({ export default Ember.Service.extend({
storeSessionItem: function(key, data) { storeSessionItem: function (key, data) {
localStorage[key] = data; localStorage[key] = data;
}, },
getSessionItem: function(key) { getSessionItem: function (key) {
return localStorage[key]; return localStorage[key];
}, },
clearSessionItem: function(key) { clearSessionItem: function (key) {
delete localStorage[key]; delete localStorage[key];
} }
}); });

View file

@ -15,7 +15,7 @@
{{#each attachments key="id" as |a index|}} {{#each attachments key="id" as |a index|}}
<li class="item"> <li class="item">
<img class="icon" src="assets/img/attachments/{{document/file-icon a.extension}}" /> <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> <span class="file">{{ a.filename }}</span>
</a> </a>
{{#if isEditor}} {{#if isEditor}}

View file

@ -6,13 +6,13 @@
</div> </div>
{{else}} {{else}}
{{#link-to 'application' class='title'}} {{#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> <i class="material-icons">apps</i>
</div> </div>
{{/link-to}} {{/link-to}}
{{/if}} {{/if}}
{{#link-to 'application' class='title'}} {{#link-to 'application' class='title'}}
{{session.appMeta.title}} {{appMeta.title}}
{{/link-to}} {{/link-to}}
</div> </div>