UX: Allow CTRL+ENTER to save topic title edits
This commit is contained in:
@@ -3,8 +3,9 @@ import Composer from 'discourse/models/composer';
|
||||
import afterTransition from 'discourse/lib/after-transition';
|
||||
import positioningWorkaround from 'discourse/lib/safari-hacks';
|
||||
import { headerHeight } from 'discourse/components/site-header';
|
||||
import KeyEnterEscape from 'discourse/mixins/key-enter-escape';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
export default Ember.Component.extend(KeyEnterEscape, {
|
||||
elementId: 'reply-control',
|
||||
|
||||
classNameBindings: ['composer.creatingPrivateMessage:private-message',
|
||||
@@ -65,17 +66,6 @@ export default Ember.Component.extend({
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
keyDown(e) {
|
||||
if (e.which === 27) {
|
||||
this.sendAction('cancelled');
|
||||
return false;
|
||||
} else if (e.which === 13 && (e.ctrlKey || e.metaKey)) {
|
||||
// CTRL+ENTER or CMD+ENTER
|
||||
this.sendAction('save');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
@observes('composeState')
|
||||
disableFullscreen() {
|
||||
if (this.get('composeState') !== Composer.OPEN && positioningWorkaround.blur) {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import KeyEnterEscape from 'discourse/mixins/key-enter-escape';
|
||||
|
||||
export default Ember.Component.extend(KeyEnterEscape, {
|
||||
elementId: 'topic-title',
|
||||
});
|
||||
Reference in New Issue
Block a user