contex menu
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user