Revision 430ef857
Von Sven Schöling vor etwa 1 Jahr hinzugefügt
js/kivi.js | ||
---|---|---|
320 | 320 |
} |
321 | 321 |
}) |
322 | 322 |
.then(editor => { |
323 |
// save instance in data |
|
323 | 324 |
$element.data('ckeditorInstance', editor); |
324 | 325 |
|
326 |
// handle auto focus |
|
325 | 327 |
if ($element.hasClass('texteditor-autofocus')) |
326 | 328 |
ns.focus_ckeditor($element); |
327 | 329 |
|
330 |
// trigger delayed hooks on the editor |
|
328 | 331 |
$element.trigger('ckeditor-ready'); |
329 | 332 |
|
333 |
// make sure blur events copy back to the textarea |
|
334 |
// this catches most of the non-submit ways that ckeditor doesn't handle |
|
335 |
// on its own. if you have any bugs, make sure to call updateSourceElement |
|
336 |
// directly before serializing the form |
|
337 |
editor.ui.focusTracker.on( 'change:isFocused', (evt, name, is_focused) => { |
|
338 |
if (!is_focused) { |
|
339 |
editor.updateSourceElement(); |
|
340 |
} |
|
341 |
}); |
|
342 |
|
|
343 |
// handle inital disabled |
|
330 | 344 |
if ($element.attr('disabled')) |
331 | 345 |
editor.enableReadOnlyMode('disabled') |
332 | 346 |
|
347 |
// handle initial height |
|
333 | 348 |
const element = $element.get(0); |
334 | 349 |
if (element.style.height) |
335 | 350 |
editor.editing.view.change((writer) => { |
Auch abrufbar als: Unified diff
ckeditor5: rückschreiben bei blur event
ckeditor speichert bei submit von alleine zurück, nicht aber bei ajax
submit. Ein blur Handler fängt die meisten submits die ausserhalb
passieren, Enter kommt gleich nach.