fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editor: canvas fix
[fnpeditor.git]
/
src
/
editor
/
plugins
/
core
/
core.js
diff --git
a/src/editor/plugins/core/core.js
b/src/editor/plugins/core/core.js
index
76be9e8
..
3921635
100644
(file)
--- a/
src/editor/plugins/core/core.js
+++ b/
src/editor/plugins/core/core.js
@@
-224,7
+224,16
@@
plugin.documentExtension.documentNode.transformations = {
} else if(prev.is({tagName: 'span'})) {
if((txtNode = prev.getLastTextNode())) {
txt = txtNode.getText();
} else if(prev.is({tagName: 'span'})) {
if((txtNode = prev.getLastTextNode())) {
txt = txtNode.getText();
- txtNode.setText(txt.substr(0, txt.length-1));
+ if(txt.length > 1) {
+ txtNode.setText(txt.substr(0, txt.length-1));
+ } else {
+ if(txtNode.parent().contents().length === 1) {
+ txtNode.parent().detach();
+ } else {
+ txtNode.detach();
+ }
+
+ }
return toret;
}
}
return toret;
}
}