diff options
| author | Rami Jasim <rami.jasim1@uni-oldenburg.de> | 2024-11-06 14:33:21 +0100 |
|---|---|---|
| committer | Rami Jasim <rami.jasim1@uni-oldenburg.de> | 2024-11-06 14:33:21 +0100 |
| commit | 4cbee668a552cebeff5a94667f12f0826edb8f1b (patch) | |
| tree | e63b42d1d74f1fcc033b5eb3d5b830a929f2b6af /resources/assets | |
| parent | 4a952ddb48c04c6f2eb6ffec60f81172bc178f03 (diff) | |
prevent console error and throw simple alertissue-4786
Diffstat (limited to 'resources/assets')
| -rw-r--r-- | resources/assets/javascripts/lib/wysiwyg.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/resources/assets/javascripts/lib/wysiwyg.js b/resources/assets/javascripts/lib/wysiwyg.js index 47c64d0..1cbd070 100644 --- a/resources/assets/javascripts/lib/wysiwyg.js +++ b/resources/assets/javascripts/lib/wysiwyg.js @@ -187,6 +187,13 @@ function enhanceEditor($textarea, ckeditor) { ckeditor.focus(); } + // catch and prevent invalid event for required textareas and trigger on the ckeditor + $textarea.on('invalid', function (e) { + e.preventDefault() + ckeditor.focus(); + alert('wyswiyg befüllen!') // TODO better notification + }) + ckeditor.ui.focusTracker.on('change:isFocused', (evt, name, isFocused) => { if (!isFocused) { ckeditor.sourceElement.value = wysiwyg.markAsHtml(ckeditor.getData()); |
