aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--resources/assets/javascripts/lib/wysiwyg.js7
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());