Implement filter by tags in navigation bar

This commit is contained in:
Matias De lellis
2019-11-08 09:22:22 -03:00
parent b5294a4810
commit 738d8a9766

View File

@@ -734,7 +734,16 @@ View.prototype = {
$('#app-navigation .nav-tag > a').click(function (event) {
event.stopPropagation();
$('.notes-grid').isotope({ filter: '*'});
var tagId = parseInt($(this).parent().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');