Skip to content

Commit

Permalink
check for a coords or focusedNode is null (#255)
Browse files Browse the repository at this point in the history
* check for a coords or focusedNode is null

* bump version
  • Loading branch information
talyguryn authored and neSpecc committed May 25, 2018
1 parent 05d657c commit b9b0713
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions codex-editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codex-editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions modules/caret.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = (function (caret) {
}

/** Looking for parent contentEditable block */
while (focusedNode.contentEditable != 'true') {
while (focusedNode && focusedNode.contentEditable != 'true') {

focusedNodeHolder = focusedNode.parentNode;
focusedNode = focusedNodeHolder;
Expand Down Expand Up @@ -302,4 +302,4 @@ module.exports = (function (caret) {

return caret;

})({});
})({});
8 changes: 7 additions & 1 deletion modules/toolbar/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ module.exports = (function (inline) {
newCoordinateX,
newCoordinateY;

if (!coords) {

return;

}

if (toolbar.offsetHeight === 0) {

defaultOffset = 40;
Expand Down Expand Up @@ -590,4 +596,4 @@ module.exports = (function (inline) {

return inline;

})({});
})({});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex.editor",
"version": "1.7.8",
"version": "1.7.9",
"description": "Codex Editor. Native JS, based on API and Open Source",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b9b0713

Please sign in to comment.