mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Pin notes.. Still dont have backend support..
This commit is contained in:
@@ -82,19 +82,28 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.note-content {
|
.note-content {
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
#div-content .shared-title,
|
.icon-header-note {
|
||||||
#div-content .shared-title-owner,
|
|
||||||
#div-content .icon-delete-note {
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
float: right;
|
float: right;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
opacity: 0.5;
|
padding: 12px;
|
||||||
|
background-color: rgba(0,0,0,0.08);
|
||||||
|
opacity: 0.7;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide-header-icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed-header-icon,
|
||||||
|
.show-header-icon {
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noselect {
|
.noselect {
|
||||||
@@ -160,11 +169,10 @@
|
|||||||
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide-delete-icon,
|
|
||||||
.hide-modal-note {
|
.hide-modal-note {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.show-delete-icon,
|
|
||||||
.show-modal-note {
|
.show-modal-note {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|||||||
23
js/script.js
23
js/script.js
@@ -439,6 +439,13 @@ View.prototype = {
|
|||||||
isFitWidth: true,
|
isFitWidth: true,
|
||||||
fitWidth: true,
|
fitWidth: true,
|
||||||
gutter: 10,
|
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.
|
// Show delete icon on hover.
|
||||||
$("#app-content").on("mouseenter", ".quicknote", function() {
|
$("#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() {
|
$("#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.
|
// 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.
|
* Modal actions.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>
|
<div>
|
||||||
<div class="icon-delete hide-delete-icon icon-delete-note" title="Delete"></div>
|
<div class="icon-header-note icon-delete hide-header-icon icon-delete-note" title="Delete"></div>
|
||||||
|
<div class="icon-header-note icon-checkmark hide-header-icon" title="Pin note"></div>
|
||||||
<!--
|
<!--
|
||||||
{{#if sharedwith}}
|
{{#if sharedwith}}
|
||||||
<div class='icon-share shared-title-owner' title="Shared with {{ sharedwith }}"></div>
|
<div class='icon-share shared-title-owner' title="Shared with {{ sharedwith }}"></div>
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>
|
<div>
|
||||||
<div class="icon-delete hide-delete-icon icon-delete-note" title="Delete"></div>
|
<div class="icon-header-note icon-delete hide-header-icon icon-delete-note" title="Delete"></div>
|
||||||
|
<div class="icon-header-note icon-checkmark hide-header-icon" title="Pin note"></div>
|
||||||
<!--
|
<!--
|
||||||
{{#if sharedwith}}
|
{{#if sharedwith}}
|
||||||
<div class='icon-share shared-title-owner' title="Shared with {{ sharedwith }}"></div>
|
<div class='icon-share shared-title-owner' title="Shared with {{ sharedwith }}"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user