diff options
| author | rr- | 2016-11-21 18:11:30 +0100 |
|---|---|---|
| committer | rr- | 2016-11-21 18:11:30 +0100 |
| commit | 9ae2b6aa4457217ff88eaaa44bfe886d6cb8d998 (patch) | |
| tree | a801f121e1f1ff9c566990ec7306abb445b1ced1 /client/js/controls | |
| parent | 42666706d9f409959dcd251ff8b60c1fbe105fa3 (diff) | |
client/notes: fix notes being added twice
Slight issue with event listeners.
Diffstat (limited to 'client/js/controls')
| -rw-r--r-- | client/js/controls/post_notes_overlay_control.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/js/controls/post_notes_overlay_control.js b/client/js/controls/post_notes_overlay_control.js index 0ca9efb..c2539bd 100644 --- a/client/js/controls/post_notes_overlay_control.js +++ b/client/js/controls/post_notes_overlay_control.js @@ -440,8 +440,8 @@ class DrawingRectangleState extends ActiveState { const y2 = this._note.polygon.at(2).y; const width = (x2 - x1) * this._control.boundingBox.width; const height = (y2 - y1) * this._control.boundingBox.height; + this._control._deleteDomNode(this._note); if (width < 20 && height < 20) { - this._control._deleteDomNode(this._note); this._control._state = new ReadyToDrawState(this._control); } else { this._control._post.notes.add(this._note); @@ -533,6 +533,7 @@ class DrawingPolygonState extends ActiveState { if (this._note.polygon.length <= 2) { this._cancel(); } else { + this._control._deleteDomNode(this._note); this._control._post.notes.add(this._note); this._control._state = new SelectedState(this._control, this._note); } |