X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3efaf2dda390ed91cdba771a490b7c81a9d292a2..ea9d7d13a44a6ad6357b1af8c977c27753268521:/src/wolnelektury/static/2021/scripts/main.js diff --git a/src/wolnelektury/static/2021/scripts/main.js b/src/wolnelektury/static/2021/scripts/main.js index 843cddbbf..3bbb38d55 100644 --- a/src/wolnelektury/static/2021/scripts/main.js +++ b/src/wolnelektury/static/2021/scripts/main.js @@ -401,7 +401,7 @@ liked: [], }; - $(".icon-like").on('click', function(e) { + $(document).on('click', '.icon-like', function(e) { e.preventDefault(); let liked = $(this).hasClass('icon-liked'); $btn = $(this); @@ -431,6 +431,7 @@ } }) + // TODO: DYNAMICALLY ADD $(".add-set-tag input[name=name]").autocomplete({ source: '/ludzie/moje-tagi/', }).on('autocompleteopen', function() { @@ -478,6 +479,7 @@ }); } refreshAll(ids); + $.refreshLikes = refreshAll; function updateFromData(data) { for (pk in data) {