diff --git a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js
index 6efd1490b..f9a688cf9 100644
--- a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js
+++ b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js
@@ -112,10 +112,6 @@
}
_this.log('paste', docType, text)
- if (!_this.maxLengthOk(text.length)) {
- return
- }
-
if (docType == 'html') {
text = '
' + text + '
' // to prevent multible dom object. we need it at level 0
if (_this.options.mode === 'textonly') {
@@ -146,6 +142,10 @@
_this.log('text2html', text)
}
+ if (!_this.maxLengthOk(text.length)) {
+ return
+ }
+
// cleanup
text = App.Utils.removeEmptyLines(text)
_this.log('insert', text)
@@ -201,6 +201,7 @@
}
this.log('maxLengthOk', length, this.options.maxlength)
if ( length > this.options.maxlength ) {
+ this.log('maxLengthOk, text too long')
// try to set error on framework form
var parent = this.$element.parent().parent()