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, {
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);

View file

@ -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];
}
});

View file

@ -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}}

View file

@ -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>