mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Add checkmarks to color filter on navigation
This commit is contained in:
16
js/script.js
16
js/script.js
@@ -315,7 +315,7 @@ View.prototype = {
|
|||||||
$('#modal-note-div .circle-toolbar').click(function (event) {
|
$('#modal-note-div .circle-toolbar').click(function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
var oldColorTool = $('.circle-toolbar.icon-checkmark');
|
var oldColorTool = $('#modal-note-div .circle-toolbar.icon-checkmark');
|
||||||
$.each(oldColorTool, function(i, oct) {
|
$.each(oldColorTool, function(i, oct) {
|
||||||
$(oct).removeClass('icon-checkmark');
|
$(oct).removeClass('icon-checkmark');
|
||||||
});
|
});
|
||||||
@@ -365,6 +365,12 @@ View.prototype = {
|
|||||||
$('#all-notes').click(function () {
|
$('#all-notes').click(function () {
|
||||||
self._notes.unsetActive();
|
self._notes.unsetActive();
|
||||||
$('.notes-grid').isotope({ filter: '*'});
|
$('.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');
|
||||||
});
|
});
|
||||||
|
|
||||||
// create a new note
|
// create a new note
|
||||||
@@ -423,10 +429,14 @@ View.prototype = {
|
|||||||
|
|
||||||
// Handle colors.
|
// Handle colors.
|
||||||
$('#app-navigation .circle-toolbar').click(function (event) {
|
$('#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');
|
||||||
|
});
|
||||||
|
$(this).addClass('icon-checkmark');
|
||||||
|
|
||||||
|
if (!$(this).hasClass("any-color")) {
|
||||||
var color = $(this).css("background-color");
|
var color = $(this).css("background-color");
|
||||||
if (color != 'transparent') {
|
|
||||||
$('.notes-grid').isotope({ filter: function() {
|
$('.notes-grid').isotope({ filter: function() {
|
||||||
var itemColor = $(this).children().css("background-color");
|
var itemColor = $(this).children().css("background-color");
|
||||||
return color == itemColor;
|
return color == itemColor;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<a href="#" class="icon-search svg">Colors</a>
|
<a href="#" class="icon-search svg">Colors</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li style="display: flex; justify-content: center;">
|
<li style="display: flex; justify-content: center;">
|
||||||
<button class="circle-toolbar" style="background: transparent none; border: 1px solid;"></button>
|
<button class="circle-toolbar icon-checkmark any-color"></button>
|
||||||
{{#each colors}}
|
{{#each colors}}
|
||||||
<button class="circle-toolbar" style="background-color: {{color}} "></button>
|
<button class="circle-toolbar" style="background-color: {{color}} "></button>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
Reference in New Issue
Block a user