From 2dfdbb645bebf4834606e8534181970a79508bb0 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Mon, 18 Dec 2017 14:57:47 -0500 Subject: [PATCH] refactor modal to bind closing event at different time this allows chaining modals after each other with closing events working --- client/galaxy/scripts/mvc/ui/ui-modal.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-modal.js b/client/galaxy/scripts/mvc/ui/ui-modal.js index 841c2aca079..d0d6200f069 100644 --- a/client/galaxy/scripts/mvc/ui/ui-modal.js +++ b/client/galaxy/scripts/mvc/ui/ui-modal.js @@ -40,17 +40,16 @@ export var View = Backbone.View.extend({ this.visible = true; this.$el.fadeIn("fast"); if (this.options.closing_events) { - var self = this; $(document).on("keyup.ui-modal", e => { if (e.keyCode == 27) { - self.hide(true); + this.hide(true); } }); - this.$backdrop.on("click", () => { - self.hide(true); - }); } } + this.$backdrop.on("click", () => { + this.hide(true); + }); }, /**