0

Aloha を使用して、1 行の見出しを WYSIWYG 編集したいと考えています。

そのためには、(改行を防ぐために) ENTER キーの押下をインターセプトし、カスタム保存イベントを発生させる必要があります。

それを行う方法はありますか?

ありがとう!

4

1 に答える 1

0

「ホットフィックス」ブランチで私のために働いたのは次のとおりです。

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;
    }
});

詳細はこちら:

https://github.com/alohaeditor/Aloha-Editor/issues/1502

于 2015-12-19T19:32:06.123 に答える