mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Composer and replying tweaks/bug-fixes
This commit is contained in:
@@ -9,7 +9,7 @@ export default Ember.Component.extend(Ember.Evented, {
|
||||
|
||||
submitLabel: 'Post Reply',
|
||||
placeholder: '',
|
||||
value: '',
|
||||
content: '',
|
||||
submit: null,
|
||||
loading: false,
|
||||
|
||||
@@ -29,21 +29,23 @@ export default Ember.Component.extend(Ember.Evented, {
|
||||
},
|
||||
|
||||
actions: {
|
||||
submit: function(value) {
|
||||
this.get('submit')(value);
|
||||
submit: function(content) {
|
||||
this.get('submit')({
|
||||
content: content
|
||||
});
|
||||
},
|
||||
|
||||
willExit: function(abort) {
|
||||
// If the user has typed something, prompt them before exiting
|
||||
// this composer state.
|
||||
if (this.get('value') && ! confirm('You have not posted your reply. Do you wish to discard it?')) {
|
||||
if (this.get('content') && ! confirm('You have not posted your reply. Do you wish to discard it?')) {
|
||||
abort();
|
||||
}
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
this.set('loading', false);
|
||||
this.set('value', '');
|
||||
this.set('content', '');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user