Improved error handling.
This commit is contained in:
parent
c6fec78bf9
commit
fde8d11b5f
1 changed files with 9 additions and 7 deletions
|
@ -104,12 +104,14 @@
|
||||||
|
|
||||||
// break <blockquote> after enter on empty line
|
// break <blockquote> after enter on empty line
|
||||||
sel = window.getSelection()
|
sel = window.getSelection()
|
||||||
node = $(sel.anchorNode)
|
if (sel) {
|
||||||
if (node.parent().is('blockquote')) {
|
node = $(sel.anchorNode)
|
||||||
e.preventDefault()
|
if (node && node.parent() && node.parent().is('blockquote')) {
|
||||||
document.execCommand('Insertparagraph')
|
e.preventDefault()
|
||||||
document.execCommand('Outdent')
|
document.execCommand('Insertparagraph')
|
||||||
return
|
document.execCommand('Outdent')
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// behavior to enter new line on alt+enter
|
// behavior to enter new line on alt+enter
|
||||||
|
@ -246,7 +248,7 @@
|
||||||
|
|
||||||
// limit check
|
// limit check
|
||||||
if ( !_this.allowKey(e) ) {
|
if ( !_this.allowKey(e) ) {
|
||||||
if ( !_this.maxLengthOk( 1 ) ) {
|
if ( !_this.maxLengthOk(1) ) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue