mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Set consistent browser titles
This commit is contained in:
parent
88b99979a9
commit
adef6dfffa
37 changed files with 140 additions and 117 deletions
|
@ -23,11 +23,12 @@ export default Component.extend(TooltipMixin, {
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) return;
|
||||
if (this.get('toEdit') === this.get('page.id') && this.get('permissions.documentEdit')) this.send('onEdit');
|
||||
|
||||
if (this.get('session.authenticated')) {
|
||||
this.workflow();
|
||||
}
|
||||
|
||||
if (this.get('toEdit') === this.get('page.id') && this.get('permissions.documentEdit')) this.send('onEdit');
|
||||
},
|
||||
|
||||
workflow() {
|
||||
|
|
|
@ -19,13 +19,13 @@ export default Component.extend({
|
|||
selectedDocuments: A([]),
|
||||
selectedCaption: 'document',
|
||||
|
||||
showAdd: computed('permissions', 'documents', function() {
|
||||
showAdd: computed('permissions.documentAdd', 'documents', function() {
|
||||
return this.get('documents.length') === 0 && this.get('permissions.documentAdd');
|
||||
}),
|
||||
showLockout: computed('permissions', 'documents', function() {
|
||||
showLockout: computed('permissions.documentAdd', 'documents', function() {
|
||||
return this.get('documents.length') === 0 && !this.get('permissions.documentAdd');
|
||||
}),
|
||||
hasDocumentActions: computed('permissions', function() {
|
||||
hasDocumentActions: computed('permissions.{documentDelete,documentMove}', function() {
|
||||
return this.get('permissions.documentDelete') || this.get('permissions.documentMove');
|
||||
}),
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ export default Component.extend(AuthMixin, {
|
|||
|
||||
this.set('documents', documents);
|
||||
let cb = this.get('onRefresh');
|
||||
cb.onRefresh();
|
||||
cb();
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
showTools: true, // show document related tools? favourite, delete, make template...
|
||||
showDocumentLink: false, // show link to document in breadcrumbs
|
||||
|
||||
init() {
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.pinState = {
|
||||
isPinned: false,
|
||||
|
@ -38,7 +38,7 @@ init() {
|
|||
description: ''
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
|
|
@ -265,17 +265,17 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
|
||||
onShowTemplateDocModal() {
|
||||
let t = this.get('templates');
|
||||
if (t.length > 0) {
|
||||
t[0].set('selected', true);
|
||||
this.modalOpen("#template-doc-modal", {"show": true}, '#template-doc-name');
|
||||
}
|
||||
t.forEach((t) => {
|
||||
t.set('selected', false);
|
||||
});
|
||||
this.modalOpen("#template-doc-modal", {"show": true}, '#template-doc-name');
|
||||
},
|
||||
|
||||
onSelectTemplate(i) {
|
||||
let t = this.get('templates');
|
||||
t.forEach((t) => {
|
||||
t.set('selected', false);
|
||||
})
|
||||
});
|
||||
i.set('selected', true);
|
||||
this.set('selectedTemplate', i.id);
|
||||
},
|
||||
|
@ -288,16 +288,17 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
this.set('templateDocNameError', true);
|
||||
$('#template-doc-name').focus();
|
||||
return;
|
||||
} else {
|
||||
this.set('templateDocNameError', false);
|
||||
this.set('templateDocName', '');
|
||||
}
|
||||
|
||||
let id = this.get('selectedTemplate');
|
||||
if (is.empty(id)) {
|
||||
$('#widget-list-picker').addClass('is-invalid');
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('templateDocNameError', false);
|
||||
this.set('templateDocName', '');
|
||||
|
||||
this.modalClose("#template-doc-modal");
|
||||
|
||||
this.get('templateService').importSavedTemplate(this.get('space.id'), id, docName).then((document) => {
|
||||
|
|
|
@ -22,10 +22,11 @@ export default Component.extend(NotifierMixin, AuthMixin, {
|
|||
copyPermission: true,
|
||||
copyDocument: false,
|
||||
hasClone: notEmpty('clonedSpace.id'),
|
||||
clonedSpace: null,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.clonedSpace = { id: '' };
|
||||
// this.clonedSpace = { id: '' };
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -63,9 +64,8 @@ export default Component.extend(NotifierMixin, AuthMixin, {
|
|||
}
|
||||
|
||||
this.set('spaceName', '');
|
||||
this.set('clonedSpace.id', '');
|
||||
this.set('clonedSpace', null);
|
||||
$("#new-space-name").removeClass("is-invalid");
|
||||
|
||||
$('#add-space-modal').modal('hide');
|
||||
$('#add-space-modal').modal('dispose');
|
||||
|
||||
|
|
|
@ -25,11 +25,6 @@ export default Component.extend({
|
|||
// leaking changes to it via a 2-way binding
|
||||
_selection: reads('selection'),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.content = [];
|
||||
},
|
||||
|
||||
actions: {
|
||||
change() {
|
||||
const selectEl = this.$('select')[0];
|
||||
|
|
|
@ -30,7 +30,6 @@ export default Component.extend({
|
|||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.items = [];
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -16,7 +16,6 @@ import miscUtil from '../utils/misc';
|
|||
export default Component.extend({
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.notifications = [];
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue