close modal when clicking outside area
This commit is contained in:
parent
a2eef21f94
commit
aed6b2bb47
2 changed files with 8 additions and 5 deletions
|
@ -10,6 +10,12 @@ $(function() {
|
|||
return true;
|
||||
});
|
||||
|
||||
$(document).on("click touchend", function(e) {
|
||||
if (!$(e.target).closest("#searchOptions, #searchOptionsButton").length) {
|
||||
$("#searchOptions").removeClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
$("[data-toggle='control-options']").click(function(e) {
|
||||
e.preventDefault();
|
||||
var target = $(this).attr("data-target") || $(this).attr("href");
|
||||
|
|
|
@ -14,11 +14,8 @@ $(function() {
|
|||
return true;
|
||||
});
|
||||
|
||||
$("#content").on("click touchend", function(e) {
|
||||
if (
|
||||
!$(e.target).closest("#searchOptions, [data-toggle='control-options']")
|
||||
.length
|
||||
) {
|
||||
$(document).on("click touchend", function(e) {
|
||||
if (!$(e.target).closest("#searchOptions, #searchOptionsButton").length) {
|
||||
$("#searchOptions").removeClass("active");
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue