[summernote] Trigger change event in code view
This commit is contained in:
parent
cd4fd8363c
commit
5d2dd18ddd
1 changed files with 9 additions and 0 deletions
|
|
@ -4771,6 +4771,15 @@
|
|||
$editor.addClass('codeview');
|
||||
$codable.focus();
|
||||
|
||||
$codable.on('keyup', function () {
|
||||
var value = $codable.val();
|
||||
var isChange = $editable.html() !== value;
|
||||
|
||||
if (isChange) {
|
||||
context.triggerEvent('change', value, $editable);
|
||||
}
|
||||
});
|
||||
|
||||
// activate CodeMirror as codable
|
||||
if (agent.hasCodeMirror) {
|
||||
var cmEditor = CodeMirror.fromTextArea($codable[0], options.codemirror);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue