refactor modal to bind closing event at different time

this allows chaining modals after each other with closing events working
This commit is contained in:
Martin Cech
2017-12-18 14:57:47 -05:00
parent 2f90fd8766
commit 2dfdbb645b
+4 -5
View File
@@ -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);
});
},
/**