This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/modal.js.es6

17 lines
549 B
JavaScript

export default Ember.View.extend({
elementId: 'discourse-modal',
templateName: 'modal/modal',
classNameBindings: [':modal', ':hidden', 'controller.modalClass'],
click: function(e) {
var $target = $(e.target);
if ($target.hasClass("modal-middle-container") ||
$target.hasClass("modal-outer-container")) {
// Delegate click to modal backdrop if clicked outside. We do this
// because some CSS of ours seems to cover the backdrop and makes it
// unclickable.
$('.modal-backdrop').click();
}
}
});