From 8f4781fc1cc218365212c1bc1f8084b3622c34d4 Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Fri, 8 Nov 2019 09:29:25 -0300 Subject: [PATCH] Filter tags clicking them on notes --- js/script.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/script.js b/js/script.js index 6fc8235..63cebef 100644 --- a/js/script.js +++ b/js/script.js @@ -470,6 +470,24 @@ View.prototype = { } }); + $('#app-content').on('click', '.slim-tag', function (event) { + event.stopPropagation(); + var tagId = parseInt($(this).data('id'), 10); + $('.notes-grid').isotope({ filter: function() { + var match = false; + $(this).find(".slim-tag").siblings().addBack().each(function() { + var id = parseInt($(this).data('id'), 10); + if (tagId === id) + match = true; + }); + return match; + }}); + var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); + $.each(oldColorTool, function(i, oct) { + $(oct).removeClass('icon-checkmark'); + }); + }); + // Remove note icon var self = this; $('#app-content').on("click", ".icon-delete-note", function (event) {