mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 17:07:24 +08:00
17 lines
554 B
JavaScript
17 lines
554 B
JavaScript
export default Ember.View.extend({
|
|
elementId: 'discourse-modal',
|
|
templateName: 'modal/modal',
|
|
classNameBindings: [':modal', ':hidden', 'controller.modalClass'],
|
|
|
|
click: function(e) {
|
|
const $target = $(e.target);
|
|
if ($target.hasClass("modal-middle-container") ||
|
|
$target.hasClass("modal-outer-container")) {
|
|
// Delegate click to modal close if clicked outside.
|
|
// We do this because some CSS of ours seems to cover
|
|
// the backdrop and makes it unclickable.
|
|
$('.modal-header a.close').click();
|
|
}
|
|
}
|
|
});
|