diff --git a/fotogalleri/gallery/static/javascript/select.js b/fotogalleri/gallery/static/javascript/select.js index 40bc15a..6f1dd84 100644 --- a/fotogalleri/gallery/static/javascript/select.js +++ b/fotogalleri/gallery/static/javascript/select.js @@ -3,15 +3,13 @@ function selectLinkOnClick(link) { const checkboxIsHidden = checkbox.is(':hidden'); if (checkboxIsHidden) { - const linkUrl = $(link).attr('data-url'); - window.location.href = linkUrl; + return + } + const checkboxIsChecked = checkbox.is(':checked'); + if (checkboxIsChecked) { + checkbox.removeAttr('checked'); } else { - const checkboxIsChecked = checkbox.is(':checked'); - if (checkboxIsChecked) { - checkbox.removeAttr('checked'); - } else { - checkbox.attr('checked', 'checked'); - } + checkbox.attr('checked', 'checked'); } } @@ -65,6 +63,12 @@ $(function() { return className !== 'selectable'; }); + if ($(selectable).attr("href")) { + $(selectable).removeAttr("href") + } else { + $(selectable).attr("href", $(selectable).attr("data-url")) + } + filteredNames.forEach(function(className) { switch (className) { case 'img-link': diff --git a/fotogalleri/gallery/templates/components/folder.html b/fotogalleri/gallery/templates/components/folder.html index 89cf701..ace3b65 100644 --- a/fotogalleri/gallery/templates/components/folder.html +++ b/fotogalleri/gallery/templates/components/folder.html @@ -1,6 +1,7 @@ {% load static %}