Improved error handling.

This commit is contained in:
Martin Edenhofer 2017-08-15 21:32:53 +02:00
parent c6fec78bf9
commit fde8d11b5f

View file

@ -104,13 +104,15 @@
// break <blockquote> after enter on empty line // break <blockquote> after enter on empty line
sel = window.getSelection() sel = window.getSelection()
if (sel) {
node = $(sel.anchorNode) node = $(sel.anchorNode)
if (node.parent().is('blockquote')) { if (node && node.parent() && node.parent().is('blockquote')) {
e.preventDefault() e.preventDefault()
document.execCommand('Insertparagraph') document.execCommand('Insertparagraph')
document.execCommand('Outdent') document.execCommand('Outdent')
return return
} }
}
// behavior to enter new line on alt+enter // behavior to enter new line on alt+enter
// on alt + enter not realy newline is fired, to make // on alt + enter not realy newline is fired, to make
@ -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
} }