diff --git a/css/style.scss b/css/style.scss index 7c68cdb..5e52bb4 100644 --- a/css/style.scss +++ b/css/style.scss @@ -2,6 +2,14 @@ @include icon-color('app', 'quicknotes', $color-black); } +.icon-pin { + @include icon-color('pin', 'quicknotes', $color-black); +} + +.icon-pinned { + @include icon-color('pinned', 'quicknotes', $color-black); +} + #app-content-wrapper { height: 100%; } @@ -101,6 +109,10 @@ border-radius: 50%; } +//.icon-header-note:hover { +// background-color: rgba(0,0,0,0.14); +//} + .hide-header-icon { display: none; } diff --git a/img/pin.svg b/img/pin.svg index 8e99b4b..622599c 100644 --- a/img/pin.svg +++ b/img/pin.svg @@ -1,3 +1 @@ - - - + diff --git a/img/pinned.svg b/img/pinned.svg index 70d764b..7779c3c 100644 --- a/img/pinned.svg +++ b/img/pinned.svg @@ -1,3 +1 @@ - - - + diff --git a/js/script.js b/js/script.js index c42b2e5..5c4e63f 100644 --- a/js/script.js +++ b/js/script.js @@ -449,7 +449,7 @@ View.prototype = { getSortData: { pinnedNote: function(itemElem) { var $item = $(itemElem); - return $item.find('.icon-checkmark').hasClass('fixed-header-icon') ? -1 : $item.index(); + return $item.find('.icon-pinned').hasClass('fixed-header-icon') ? -1 : $item.index(); } } }); @@ -583,15 +583,23 @@ View.prototype = { ); }); - $('#app-content').on("click", ".icon-checkmark", function (event) { + $('#app-content').on("click", ".icon-pin", function (event) { event.stopPropagation(); - if ($(this).hasClass("fixed-header-icon")) { - $(this).removeClass("fixed-header-icon"); - $(this).addClass("hide-header-icon"); - } else { - $(this).removeClass("hide-header-icon"); - $(this).addClass("fixed-header-icon"); - } + $(this).removeClass("hide-header-icon"); + $(this).addClass("fixed-header-icon"); + $(this).removeClass("icon-pin"); + $(this).addClass("icon-pinned"); + + $('.notes-grid').isotope('updateSortData').isotope(); + }); + + $('#app-content').on("click", ".icon-pinned", function (event) { + event.stopPropagation(); + $(this).removeClass("fixed-header-icon"); + $(this).addClass("hide-header-icon"); + $(this).removeClass("icon-pinned"); + $(this).addClass("icon-pin"); + $('.notes-grid').isotope('updateSortData').isotope(); }); diff --git a/js/templates/note-item.handlebars b/js/templates/note-item.handlebars index ef1091c..f554554 100644 --- a/js/templates/note-item.handlebars +++ b/js/templates/note-item.handlebars @@ -12,7 +12,7 @@ {{else}}
-
+