fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: DocumentNode.isInDocument syntactic sugar
[fnpeditor.git]
/
src
/
editor
/
modules
/
documentCanvas
/
canvas
/
keyboard.js
diff --git
a/src/editor/modules/documentCanvas/canvas/keyboard.js
b/src/editor/modules/documentCanvas/canvas/keyboard.js
index
f879851
..
383ca18
100644
(file)
--- a/
src/editor/modules/documentCanvas/canvas/keyboard.js
+++ b/
src/editor/modules/documentCanvas/canvas/keyboard.js
@@
-183,11
+183,14
@@
handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE],
var cursor = canvas.getCursor(),
position = canvas.getCursor().getPosition(),
element = position.element,
var cursor = canvas.getCursor(),
position = canvas.getCursor().getPosition(),
element = position.element,
- node = element
.wlxmlNode
,
+ node = element
? element.wlxmlNode : null
,
direction = 'above',
caretTo = 'end',
goto;
direction = 'above',
caretTo = 'end',
goto;
+ if(!element || !node) {
+ return;
+ }
if(event.which === KEYS.DELETE) {
direction = 'below';
if(event.which === KEYS.DELETE) {
direction = 'below';