From b5294a4810848a6449e9a45114e5c62ff9bbfff1 Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Fri, 8 Nov 2019 08:49:27 -0300 Subject: [PATCH] Open and collapse tag nav... --- js/script.js | 56 +++++++++++++++++++----------- js/templates/navigation.handlebars | 6 ++-- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/js/script.js b/js/script.js index 650bc18..77df9f0 100644 --- a/js/script.js +++ b/js/script.js @@ -677,6 +677,8 @@ View.prototype = { }); }); + /* Colors Navigation */ + $('#colors-folder').click(function () { $(this).toggleClass("open"); }); @@ -685,30 +687,11 @@ View.prototype = { event.stopPropagation(); }); - $('#notes-folder').click(function () { - $(this).toggleClass("open"); - }); - - // show a note - $('#app-navigation .note > a').click(function (event) { - event.stopPropagation(); - var id = parseInt($(this).parent().data('id'), 10); - $('.notes-grid').isotope({ filter: function() { - var itemId = parseInt($(this).children().data('id'), 10); - return id == itemId; - }}); - var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); - $.each(oldColorTool, function(i, oct) { - $(oct).removeClass('icon-checkmark'); - }); - }); - - // Handle colors. $('#app-navigation .circle-toolbar').click(function (event) { event.stopPropagation(); var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); $.each(oldColorTool, function(i, oct) { - $(oct).removeClass('icon-checkmark'); + $(oct).removeClass('icon-checkmark'); }); $(this).addClass('icon-checkmark'); @@ -724,6 +707,39 @@ View.prototype = { } }); + /* Notes Navigation */ + + $('#notes-folder').click(function () { + $(this).toggleClass("open"); + }); + + $('#app-navigation .nav-note > a').click(function (event) { + event.stopPropagation(); + var id = parseInt($(this).parent().data('id'), 10); + $('.notes-grid').isotope({ filter: function() { + var itemId = parseInt($(this).children().data('id'), 10); + return id == itemId; + }}); + var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); + $.each(oldColorTool, function(i, oct) { + $(oct).removeClass('icon-checkmark'); + }); + }); + + /* Tags Navigation */ + + $('#tags-folder').click(function () { + $(this).toggleClass("open"); + }); + + $('#app-navigation .nav-tag > a').click(function (event) { + event.stopPropagation(); + $('.notes-grid').isotope({ filter: '*'}); + var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); + $.each(oldColorTool, function(i, oct) { + $(oct).removeClass('icon-checkmark'); + }); + }); }, render: function () { this.renderNavigation(); diff --git a/js/templates/navigation.handlebars b/js/templates/navigation.handlebars index 4736110..b4002df 100644 --- a/js/templates/navigation.handlebars +++ b/js/templates/navigation.handlebars @@ -25,18 +25,18 @@ {{notesTxt}} -
  • +
  • {{tagsTxt}}