diff --git a/src/main/webapp/js/help.js b/src/main/webapp/js/help.js index 02a9ce947..e0cc0fefe 100644 --- a/src/main/webapp/js/help.js +++ b/src/main/webapp/js/help.js @@ -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"); diff --git a/src/main/webapp/js/search.js b/src/main/webapp/js/search.js index f00c89c78..d65b334e2 100644 --- a/src/main/webapp/js/search.js +++ b/src/main/webapp/js/search.js @@ -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"); } });