1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00

Set consistent browser titles

This commit is contained in:
sauls8t 2018-01-24 13:23:11 +00:00
parent 88b99979a9
commit adef6dfffa
37 changed files with 140 additions and 117 deletions

View file

@ -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) => {