From eb2e70974919a8fffa8bcd30c7307a0aef097c4c Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 22 Sep 2016 16:55:08 -0500 Subject: [PATCH] Makes sure we always resolve(call the callback) in feedback dialog. Call the callback even when clicking outside the dialog, or escaping to close it. --- modules/UI/feedback/FeedbackWindow.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/UI/feedback/FeedbackWindow.js b/modules/UI/feedback/FeedbackWindow.js index 5807aaee8..6a2b1882f 100644 --- a/modules/UI/feedback/FeedbackWindow.js +++ b/modules/UI/feedback/FeedbackWindow.js @@ -176,6 +176,13 @@ export default class Dialog { }); this.$el = this.window.$el; + AJS.dialog2(selector).on("hide", function() { + if (this.onCloseCallback) { + this.onCloseCallback(); + this.onCloseCallback = null; + } + }.bind(this)); + this.setState(); } @@ -201,11 +208,6 @@ export default class Dialog { hide() { this.window.hide(); - - if (this.onCloseCallback) { - this.onCloseCallback(); - this.onCloseCallback = null; - } } onFeedbackSubmitted() {