Skip to content

Commit

Permalink
Avoid reparse after initial render
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Dec 14, 2015
1 parent 15dfb9e commit a30897b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/js/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ class Editor {
throw new Error('Cannot render an editor twice. Use `rerender` to update the rendering of an existing editor instance');
}

this.element = element;

addClassName(this.element, EDITOR_ELEMENT_CLASS_NAME);
addClassName(element, EDITOR_ELEMENT_CLASS_NAME);
element.spellcheck = this.spellcheck;

clearChildNodes(element);

this.element = element;

if (this.isEditable === null) {
this.enableEditing();
}

clearChildNodes(element);

this._setupListeners();
this._addTooltip();

// A call to `run` will trigger the didUpdatePostCallbacks hooks with a
Expand All @@ -167,6 +167,8 @@ class Editor {
if (this.autofocus) {
this.element.focus();
}

this._setupListeners();
}

_addTooltip() {
Expand Down

0 comments on commit a30897b

Please sign in to comment.