mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 06:13:43 +08:00
24 lines
402 B
Plaintext
24 lines
402 B
Plaintext
|
export default Ember.Component.extend({
|
||
|
tagName: "",
|
||
|
|
||
|
buffer: "",
|
||
|
editing: false,
|
||
|
|
||
|
init() {
|
||
|
this._super(...arguments);
|
||
|
this.set("editing", false);
|
||
|
},
|
||
|
|
||
|
actions: {
|
||
|
edit() {
|
||
|
this.set("buffer", this.get("value"));
|
||
|
this.toggleProperty("editing");
|
||
|
},
|
||
|
|
||
|
save() {
|
||
|
// Action has to toggle 'editing' property.
|
||
|
this.action(this.get("buffer"));
|
||
|
}
|
||
|
}
|
||
|
});
|