diff --git a/themes/default/js/mcs.js b/themes/default/js/mcs.js index 318bc2cce..0a9a991ba 100644 --- a/themes/default/js/mcs.js +++ b/themes/default/js/mcs.js @@ -368,8 +368,45 @@ $(document).ready(function () { }); // Set second param to true to trigger reload performSearch(PS_params ,true); + }); + + /** + * Tags & Albums found + */ + $(".mcs-tags-found").on('click', function () { + $(".tags-found-popin").show(); + }); + $(".mcs-albums-found").on('click', function () { + $(".albums-found-popin").show(); + }); + + $(document).on('keyup', function (e) { + // 27 is 'Escape' + if(e.keyCode === 27) { + $(".tags-found-popin .tags-found-close").trigger('click'); + $(".albums-found-popin .albums-found-close").trigger('click'); + } + }); + + $(".tags-found-popin").on('click', function(e) { + if ($(this).is(e.target) && $(this).has(e.target).length === 0) { + $(".tags-found-popin .tags-found-close").trigger('click'); + } + }); + $(".tags-found-close").on('click', function () { + $(".tags-found-popin").hide(); + }); + + $(".albums-found-popin").on('click', function(e) { + if ($(this).is(e.target) && $(this).has(e.target).length === 0) { + $(".albums-found-popin .albums-found-close").trigger('click'); + } + }); + $(".albums-found-close").on('click', function () { + $(".albums-found-popin").hide(); }) + /** * Filter Word */ diff --git a/themes/default/template/index.tpl b/themes/default/template/index.tpl index 049ccfb1c..abc1b18d8 100644 --- a/themes/default/template/index.tpl +++ b/themes/default/template/index.tpl @@ -563,11 +563,33 @@ str_empty_search_bot_alt = "{'Pre-established filters are proposed, but you can 555
{'Tags found'|@translate}
-{'Albums found'|@translate}