mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
Open and collapse tag nav...
This commit is contained in:
54
js/script.js
54
js/script.js
@@ -677,6 +677,8 @@ View.prototype = {
|
||||
});
|
||||
});
|
||||
|
||||
/* Colors Navigation */
|
||||
|
||||
$('#colors-folder').click(function () {
|
||||
$(this).toggleClass("open");
|
||||
});
|
||||
@@ -685,25 +687,6 @@ View.prototype = {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#notes-folder').click(function () {
|
||||
$(this).toggleClass("open");
|
||||
});
|
||||
|
||||
// show a note
|
||||
$('#app-navigation .note > a').click(function (event) {
|
||||
event.stopPropagation();
|
||||
var id = parseInt($(this).parent().data('id'), 10);
|
||||
$('.notes-grid').isotope({ filter: function() {
|
||||
var itemId = parseInt($(this).children().data('id'), 10);
|
||||
return id == itemId;
|
||||
}});
|
||||
var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark');
|
||||
$.each(oldColorTool, function(i, oct) {
|
||||
$(oct).removeClass('icon-checkmark');
|
||||
});
|
||||
});
|
||||
|
||||
// Handle colors.
|
||||
$('#app-navigation .circle-toolbar').click(function (event) {
|
||||
event.stopPropagation();
|
||||
var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark');
|
||||
@@ -724,6 +707,39 @@ View.prototype = {
|
||||
}
|
||||
});
|
||||
|
||||
/* Notes Navigation */
|
||||
|
||||
$('#notes-folder').click(function () {
|
||||
$(this).toggleClass("open");
|
||||
});
|
||||
|
||||
$('#app-navigation .nav-note > a').click(function (event) {
|
||||
event.stopPropagation();
|
||||
var id = parseInt($(this).parent().data('id'), 10);
|
||||
$('.notes-grid').isotope({ filter: function() {
|
||||
var itemId = parseInt($(this).children().data('id'), 10);
|
||||
return id == itemId;
|
||||
}});
|
||||
var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark');
|
||||
$.each(oldColorTool, function(i, oct) {
|
||||
$(oct).removeClass('icon-checkmark');
|
||||
});
|
||||
});
|
||||
|
||||
/* Tags Navigation */
|
||||
|
||||
$('#tags-folder').click(function () {
|
||||
$(this).toggleClass("open");
|
||||
});
|
||||
|
||||
$('#app-navigation .nav-tag > a').click(function (event) {
|
||||
event.stopPropagation();
|
||||
$('.notes-grid').isotope({ filter: '*'});
|
||||
var oldColorTool = $('#app-navigation .circle-toolbar.icon-checkmark');
|
||||
$.each(oldColorTool, function(i, oct) {
|
||||
$(oct).removeClass('icon-checkmark');
|
||||
});
|
||||
});
|
||||
},
|
||||
render: function () {
|
||||
this.renderNavigation();
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
<a href="#" class="icon-folder svg">{{notesTxt}}</a>
|
||||
<ul>
|
||||
{{#each notes}}
|
||||
<li class="note with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<li class="nav-note with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<a href="#">{{{ title }}}</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</li>
|
||||
<li id="notes-folder" class="collapsible open">
|
||||
<li id="tags-folder" class="collapsible open">
|
||||
<button class="collapse"></button>
|
||||
<a href="#" class="icon-folder svg">{{tagsTxt}}</a>
|
||||
<ul>
|
||||
{{#each tags}}
|
||||
<li class="note with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<li class="nav-tag with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<a href="#">{{{ name }}}</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
Reference in New Issue
Block a user