From a4eeaf9128931a420f759e6287c8e60f181d02cf Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Tue, 16 Jun 2020 12:43:23 -0300 Subject: [PATCH] Restore shares navigation --- js/script.js | 56 ++++++++++++++++++------------ js/templates/navigation.handlebars | 12 +++++++ js/templates/notes.handlebars | 2 +- 3 files changed, 46 insertions(+), 24 deletions(-) diff --git a/js/script.js b/js/script.js index ef3f603..057865a 100644 --- a/js/script.js +++ b/js/script.js @@ -563,30 +563,8 @@ View.prototype = { $('#app-navigation ul').html(html); - // show all notes - $('#all-notes').click(function () { - $('.notes-grid').isotope({ filter: '*'}); + /* Create a new note */ - var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); - $.each(oldColorTool, function(i, oct) { - $(oct).removeClass('icon-checkmark'); - }); - $('#app-navigation .any-color').addClass('icon-checkmark'); - }); - - $('#shared-with-you').click(function () { - $('.notes-grid').isotope({ filter: function() { - return $(this).children().hasClass('shared'); - } }); - }); - - $('#shared-by-you').click(function () { - $('.notes-grid').isotope({ filter: function() { - return $(this).children().hasClass('shareowner'); - } }); - }); - - // create a new note var self = this; $('#new-note').click(function () { var fakenote = { @@ -611,6 +589,38 @@ View.prototype = { }); }); + /* Show all notes */ + + $('#all-notes').click(function () { + $('.notes-grid').isotope({ filter: '*'}); + + var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark'); + $.each(oldColorTool, function(i, oct) { + $(oct).removeClass('icon-checkmark'); + }); + $('#app-navigation .any-color').addClass('icon-checkmark'); + }); + + /* Shares Navigation */ + + $('#shared-folder').click(function () { + $(this).toggleClass("open"); + }); + + $('#shared-with-you').click(function (event) { + event.stopPropagation(); + $('.notes-grid').isotope({ filter: function() { + return $(this).children().hasClass('shared'); + } }); + }); + + $('#shared-by-you').click(function (event) { + event.stopPropagation(); + $('.notes-grid').isotope({ filter: function() { + return $(this).children().hasClass('shareowner'); + } }); + }); + /* Colors Navigation */ $('#colors-folder').click(function () { diff --git a/js/templates/navigation.handlebars b/js/templates/navigation.handlebars index 4b5dc3c..5928b1c 100644 --- a/js/templates/navigation.handlebars +++ b/js/templates/navigation.handlebars @@ -8,6 +8,18 @@ {{allNotesTxt}} +
  • + + {{t "quicknotes" "Shares" }} + +
  • {{colorsTxt}} diff --git a/js/templates/notes.handlebars b/js/templates/notes.handlebars index 693c6c0..ce783f6 100644 --- a/js/templates/notes.handlebars +++ b/js/templates/notes.handlebars @@ -2,7 +2,7 @@
    {{#each notes}}
    -
    +
    {{#each attachts}}