discourse/app/assets/javascripts/admin/components/admin-editable-field.js.es6
2019-05-27 10:15:39 +02:00

24 lines
388 B
JavaScript

export default Ember.Component.extend({
tagName: "",
buffer: "",
editing: false,
init() {
this._super(...arguments);
this.set("editing", false);
},
actions: {
edit() {
this.set("buffer", this.value);
this.toggleProperty("editing");
},
save() {
// Action has to toggle 'editing' property.
this.action(this.buffer);
}
}
});