mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Update modal with tags on dialog.
This commit is contained in:
15
js/script.js
15
js/script.js
@@ -203,12 +203,14 @@ View.prototype = {
|
||||
var modal = $('#modal-note-div');
|
||||
var modaltitle = $('#modal-note-div #title-editable');
|
||||
var modalcontent = $('#modal-note-div #content-editable');
|
||||
var modaltags = $('#modal-note-div .note-tags');
|
||||
var modalnote = $("#modal-note-div .quicknote");
|
||||
|
||||
var note = $('.notes-grid [data-id=' + id + ']').parent();
|
||||
|
||||
var title = note.find(".note-title").html();
|
||||
var content = note.find(".note-content").html();
|
||||
var tags = note.find(".note-tags").html();
|
||||
var color = note.children().css("background-color");
|
||||
var colors = modal[0].getElementsByClassName("circle-toolbar");
|
||||
$.each(colors, function(i, c) {
|
||||
@@ -225,6 +227,7 @@ View.prototype = {
|
||||
modalnote.data('id', id);
|
||||
modaltitle.html(title);
|
||||
modalcontent.html(content);
|
||||
modaltags.html(tags);
|
||||
modalnote.css("background-color", color);
|
||||
|
||||
var autolist = new AutoList();
|
||||
@@ -620,12 +623,14 @@ View.prototype = {
|
||||
QnDialogs.tags(
|
||||
self._tags.getAll(),
|
||||
self._notes.getActive().tags,
|
||||
function(result, value) {
|
||||
function(result, newTags) {
|
||||
if (result === true) {
|
||||
OC.Notification.showTemporary("TEST TAGS DIALOG OK");
|
||||
}
|
||||
else {
|
||||
OC.Notification.showTemporary("TEST TAGS DIALOG CANCEL");
|
||||
var modalTags = $('#modal-note-div .note-tags');
|
||||
modalTags.html('');
|
||||
newTags.forEach(function (item, index) {
|
||||
var tag = $('<div class="slim-tag" data-id="-1">' + item + '</div>');
|
||||
modalTags.append(tag);
|
||||
});
|
||||
}
|
||||
},
|
||||
true,
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<div contenteditable="true" id='title-editable' class='note-title'></div>
|
||||
</div>
|
||||
<div contenteditable="true" id='content-editable' class='note-content'></div>
|
||||
<div class='note-tags'></div>
|
||||
<div class="note-options">
|
||||
<!--
|
||||
<select class="note-share-select" name="users[]" multiple="multiple"></select>
|
||||
|
||||
Reference in New Issue
Block a user