Pin notes.. Still dont have backend support..

This commit is contained in:
Matias De lellis
2020-05-27 21:54:24 -03:00
parent 29d13f3321
commit c7cdb9cd6b
4 changed files with 40 additions and 11 deletions

View File

@@ -439,6 +439,13 @@ View.prototype = {
isFitWidth: true,
fitWidth: true,
gutter: 10,
},
sortBy: 'pinnedNote',
getSortData: {
pinnedNote: function(itemElem) {
var $item = $(itemElem);
return $item.find('.icon-checkmark').hasClass('fixed-header-icon') ? -1 : $item.index();
}
}
});
@@ -450,10 +457,10 @@ View.prototype = {
// Show delete icon on hover.
$("#app-content").on("mouseenter", ".quicknote", function() {
$(this).find(".icon-delete").addClass( "show-delete-icon");
$(this).find(".icon-header-note").addClass( "show-header-icon");
});
$("#app-content").on("mouseleave", ".quicknote", function() {
$(this).find(".icon-delete").removeClass("show-delete-icon");
$(this).find(".icon-header-note").removeClass("show-header-icon");
});
// Open notes when clicking them.
@@ -566,6 +573,18 @@ View.prototype = {
);
});
$('#app-content').on("click", ".icon-checkmark", 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");
}
$('.notes-grid').isotope('updateSortData').isotope();
});
/*
* Modal actions.
*/