I'd like to use Aloha to WYSIWYG-edit single-line headlines.
For that I need to intercept ENTER keypress (to prevent line-break) and fire custom save event.
Is there a way to do that?
Thanks!
Here's what worked for me on "hotfix" branch:
Aloha.bind('aloha-smart-content-changed', function(e, data) {
value = data.editable.getContents();
// save it to database.
});
Aloha.bind('aloha-command-will-execute', function(e, data) {
if (data.commandId == 'insertlinebreak') {
data.preventDefault = true;
}
});
More info here: