mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 11:33:06 +08:00
FIX: clicking the 'edit permission' button would close the category modal
This commit is contained in:
parent
c093187d34
commit
357c43e941
|
@ -4,10 +4,14 @@ export default Ember.View.extend({
|
||||||
classNameBindings: [':modal', ':hidden', 'controller.modalClass'],
|
classNameBindings: [':modal', ':hidden', 'controller.modalClass'],
|
||||||
|
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
|
var $target = $(e.target);
|
||||||
|
// some buttons get removed from the DOM when you click on them.
|
||||||
|
// we don't want to close the modal when we click on those...
|
||||||
|
if ($target.parent().length > 0 &&
|
||||||
|
$target.closest('.modal-inner-container').length === 0) {
|
||||||
// Delegate click to modal backdrop if clicked outside. We do this
|
// Delegate click to modal backdrop if clicked outside. We do this
|
||||||
// because some CSS of ours seems to cover the backdrop and makes it
|
// because some CSS of ours seems to cover the backdrop and makes it
|
||||||
// unclickable.
|
// unclickable.
|
||||||
if ($(e.target).closest('.modal-inner-container').length === 0) {
|
|
||||||
$('.modal-backdrop').click();
|
$('.modal-backdrop').click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user