mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Fix double use of data-id on tags
This commit is contained in:
12
js/script.js
12
js/script.js
@@ -314,7 +314,7 @@ View.prototype = {
|
||||
var color = this.colorToHex($("#modal-note-div .quicknote").css("background-color"));
|
||||
var tags = $("#modal-note-div .slim-tag").toArray().map(function (value) {
|
||||
return {
|
||||
id: value.getAttribute('data-id'),
|
||||
id: value.getAttribute('tag-id'),
|
||||
name: value.textContent.trim()
|
||||
};
|
||||
});
|
||||
@@ -468,11 +468,11 @@ View.prototype = {
|
||||
|
||||
$('#app-content').on('click', '.slim-tag', function (event) {
|
||||
event.stopPropagation();
|
||||
var tagId = parseInt($(this).data('id'), 10);
|
||||
var tagId = parseInt($(this).attr('tag-id'), 10);
|
||||
$('.notes-grid').isotope({ filter: function() {
|
||||
var match = false;
|
||||
$(this).find(".slim-tag").siblings().addBack().each(function() {
|
||||
var id = parseInt($(this).data('id'), 10);
|
||||
var id = parseInt($(this).attr('tag-id'), 10);
|
||||
if (tagId === id)
|
||||
match = true;
|
||||
});
|
||||
@@ -621,7 +621,7 @@ View.prototype = {
|
||||
modalTags.html('');
|
||||
newTags.forEach(function (item, index) {
|
||||
var noteId = parseInt(item.id) || -1;
|
||||
var tag = $('<div class="slim-tag" data-id="' + noteId + '">' + item.text + '</div>');
|
||||
var tag = $('<div class="slim-tag" tag-id="' + noteId + '">' + item.text + '</div>');
|
||||
modalTags.append(tag);
|
||||
});
|
||||
}
|
||||
@@ -773,11 +773,11 @@ View.prototype = {
|
||||
|
||||
$('#app-navigation .nav-tag > a').click(function (event) {
|
||||
event.stopPropagation();
|
||||
var tagId = parseInt($(this).parent().data('id'), 10);
|
||||
var tagId = parseInt($(this).parent().attr('tag-id'), 10);
|
||||
$('.notes-grid').isotope({ filter: function() {
|
||||
var match = false;
|
||||
$(this).find(".slim-tag").siblings().addBack().each(function() {
|
||||
var id = parseInt($(this).data('id'), 10);
|
||||
var id = parseInt($(this).attr('tag-id'), 10);
|
||||
if (tagId === id)
|
||||
match = true;
|
||||
});
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
</li>
|
||||
<li id="tags-folder" class="collapsible open">
|
||||
<button class="collapse"></button>
|
||||
<a href="#" class="icon-folder svg">{{tagsTxt}}</a>
|
||||
<a href="#" class="icon-tag svg">{{tagsTxt}}</a>
|
||||
<ul>
|
||||
{{#each tags}}
|
||||
<li class="nav-tag with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<li class="nav-tag with-menu {{#if active}}active{{/if}}" tag-id="{{ id }}">
|
||||
<a href="#">{{{ name }}}</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
<div class='note-tags'>
|
||||
{{#each tags}}
|
||||
<div class="slim-tag" data-id="{{ id }}">{{{ name }}}</div>
|
||||
<div class="slim-tag" tag-id="{{ id }}">{{{ name }}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
<div class='note-tags'>
|
||||
{{#each tags}}
|
||||
<div class='slim-tag' data-id="{{ id }}">
|
||||
<div class='slim-tag' tag-id="{{ id }}">
|
||||
{{{ name }}}
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
Reference in New Issue
Block a user