Last active
August 29, 2015 14:11
-
-
Save poteto/0db533ab0008562c92d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.TextArea.reopen({ | |
keyDown: function(event) { | |
if (this._isValidCombination(event)) { | |
this.sendAction('modifiedSubmit'); | |
} | |
}, | |
_hasCorrectModifier: function(event) { | |
return event.ctrlKey || event.metaKey; | |
}, | |
_isCorrectKeyCode: function(keyCode) { | |
return keyCode === 13; | |
}, | |
_isValidCombination: function(event) { | |
return this._hasCorrectModifier(event) && this._isCorrectKeyCode(event.keyCode); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment