Add edit-content buttons and states

This commit is contained in:
2018-03-31 19:35:46 +02:00
parent 693769d41c
commit ddecda8220
5 changed files with 33 additions and 1 deletions

View File

@@ -14,6 +14,11 @@ export default Controller.extend({
queryParams: ['path'],
documentIsEditable: computed.not('model.documentMetaData.isBinary'),
documentShowEditor: false,
documentHideEditor: computed.not('documentShowEditor'),
documentIsJSON: computed('model.documentMetaData.type', function(){
if (isEmpty(this.get('model.documentMetaData'))) { return false; }
@@ -46,6 +51,16 @@ export default Controller.extend({
this.set('jsonView', 'source');
},
showEditor () {
this.set('documentShowEditor', true);
// TODO init editing
},
cancelEditor () {
this.set('documentShowEditor', false);
// TODO remove changes from tree/source
},
toggleMetadata () {
this.toggleProperty('metadataHidden');
},