contex menu

This commit is contained in:
David Štaleker
2024-02-29 06:40:49 +01:00
parent 26a78d5188
commit 52f4900103
19 changed files with 3111 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ $(function () {
$('.div-note-edit-color>div').removeClass('active');
$(this).addClass('active');
});
});
@@ -18,7 +19,7 @@ function addNewNote(){
return;
}
let tmpId = -1;
let tmpZindex = 1;
let tmpZindex = 50;
notes.forEach(note => {
if (note.id <= tmpId){
tmpId = note.id -1;
@@ -33,6 +34,45 @@ function addNewNote(){
note.refresh();
}
function noteChangeZindex(id, front){
let note = getNote(id);
let maxIndex = 0;
let minIndex = 999999999999;
notes.forEach(tmpNote => {
if (tmpNote.zindex > maxIndex){
maxIndex = tmpNote.zindex;
}
if (tmpNote.zindex < minIndex){
minIndex = tmpNote.zindex;
}
});
if (front){
//ce je isti ga potem ne premikam
if (note.zindex != maxIndex){
note.zindex = maxIndex + 1;
}
} else {
if (note.zindex != minIndex){
note.zindex = minIndex - 1;
}
}
note.refresh();
}
function deleteNote(id){
let note = getNote(id);
note.element.remove();
let newArray = [];
notes.forEach(tmpNote => {
if (tmpNote.id != note.id){
newArray.push(tmpNote);
}
});
notes = newArray;
}
function openModalEditNote(id){
$('#inpModalEditNoteIdNote').val(id);
note = getNote(id);