From 8e9ddf796f156576d88ac7db9b7eeecc8ab393bc Mon Sep 17 00:00:00 2001 From: rr- Date: Fri, 5 Aug 2016 22:29:12 +0200 Subject: [PATCH] client/notes: add exit prompt for polygon changes --- client/js/controls/post_edit_sidebar_control.js | 4 ++++ client/js/controls/post_notes_overlay_control.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index 59109bd7..2c279d4d 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -131,6 +131,10 @@ class PostEditSidebarControl extends events.EventTarget { this.dispatchEvent(new CustomEvent('change')); }); } + this._postNotesOverlayControl.addEventListener( + 'change', e => { + this.dispatchEvent(new CustomEvent('change')); + }); } if (this._noteTextareaNode) { diff --git a/client/js/controls/post_notes_overlay_control.js b/client/js/controls/post_notes_overlay_control.js index ef9b293c..d29da2c7 100644 --- a/client/js/controls/post_notes_overlay_control.js +++ b/client/js/controls/post_notes_overlay_control.js @@ -723,12 +723,15 @@ class PostNotesOverlayControl extends events.EventTarget { note.polygon.addEventListener('change', e => { this._updateEdgeNode(e.detail.point, note); + this.dispatchEvent(new CustomEvent('change')); }); note.polygon.addEventListener('remove', e => { this._deleteEdgeNode(e.detail.point, note); + this.dispatchEvent(new CustomEvent('change')); }); note.polygon.addEventListener('add', e => { this._createEdgeNode(e.detail.point, groupNode); + this.dispatchEvent(new CustomEvent('change')); }); this._svgNode.appendChild(groupNode);