mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 14:35:58 +08:00
25 lines
424 B
JavaScript
25 lines
424 B
JavaScript
import Component from "@ember/component";
|
|
export default 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);
|
|
}
|
|
}
|
|
});
|