Skip to content

Commit

Permalink
rerender and didUpdate should be scheduled
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Aug 17, 2015
1 parent 9a5c62e commit 7e8a35c
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/js/editor/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class PostEditor {
changedSections.forEach(section => section.renderNode.markDirty());
removedSections.forEach(section => section.renderNode.scheduleForRemoval());

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();

return {
currentMarker,
Expand Down Expand Up @@ -113,8 +113,8 @@ class PostEditor {
}
}

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();

return {
currentMarker: nextCursorMarker,
Expand Down Expand Up @@ -171,8 +171,8 @@ class PostEditor {
});
}

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();

return selectedMarkers;
}
Expand All @@ -195,8 +195,8 @@ class PostEditor {
post.sections.insertAfter(afterSection, beforeSection);
post.renderNode.markDirty();

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();

return [beforeSection, afterSection];
}
Expand All @@ -208,8 +208,8 @@ class PostEditor {
marker.section.renderNode.markDirty();
});

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();

return markers;
}
Expand All @@ -221,8 +221,8 @@ class PostEditor {
marker.section.renderNode.markDirty();
});

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();

return markers;
}
Expand All @@ -231,15 +231,15 @@ class PostEditor {
this.editor.post.sections.insertBefore(section, beforeSection);
this.editor.post.renderNode.markDirty();

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();
}

removeSection(section) {
section.renderNode.scheduleForRemoval();

this.rerender();
this.didUpdate();
this.scheduleRerender();
this.scheduleDidUpdate();
}

/**
Expand All @@ -257,7 +257,7 @@ class PostEditor {
* Add a rerender job to the queue
*
*/
rerender() {
scheduleRerender() {
this.schedule(() => {
if (!this._didRerender) {
this._didRerender = true;
Expand All @@ -270,7 +270,7 @@ class PostEditor {
* Add an update notice job to the queue
*
*/
didUpdate() {
scheduleDidUpdate() {
this.schedule(() => {
if (!this._didUpdate) {
this._didUpdate = true;
Expand Down

0 comments on commit 7e8a35c

Please sign in to comment.