mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 15:47:17 +01:00
Implement filter by tags in navigation bar
This commit is contained in:
11
js/script.js
11
js/script.js
@@ -734,7 +734,16 @@ View.prototype = {
|
|||||||
|
|
||||||
$('#app-navigation .nav-tag > a').click(function (event) {
|
$('#app-navigation .nav-tag > a').click(function (event) {
|
||||||
event.stopPropagation();
|
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');
|
var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark');
|
||||||
$.each(oldColorTool, function(i, oct) {
|
$.each(oldColorTool, function(i, oct) {
|
||||||
$(oct).removeClass('icon-checkmark');
|
$(oct).removeClass('icon-checkmark');
|
||||||
|
|||||||
Reference in New Issue
Block a user