Fixed length check, check length after pasted content is cleaned.
This commit is contained in:
parent
a2527423af
commit
e42a4a750a
1 changed files with 5 additions and 4 deletions
|
@ -112,10 +112,6 @@
|
|||
}
|
||||
_this.log('paste', docType, text)
|
||||
|
||||
if (!_this.maxLengthOk(text.length)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (docType == 'html') {
|
||||
text = '<div>' + text + '</div>' // 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()
|
||||
|
|
Loading…
Reference in a new issue