barve, shranjevanje

This commit is contained in:
David Štaleker
2024-02-28 20:04:20 +01:00
parent dc24cb22a6
commit 26a78d5188
11 changed files with 1239 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
class Note{
constructor(id, divCanvas, x, y, width, height, content) {
constructor(id, divCanvas, x, y, width, height, content, colorClass, zindex) {
this.id = id;
this.divCanvas = divCanvas;
this.x = x;
@@ -8,6 +8,8 @@ class Note{
this.height = height;
this.element = null;
this.content = content;
this.colorClass = colorClass;
this.zindex = zindex;
}
refresh(){
@@ -16,7 +18,7 @@ class Note{
}
this.element = $(`
<div class="card div-note" data-id="${this.id}">
<div class="card div-note ${this.colorClass}" data-id="${this.id}">
<div class="card-body">
${this.content}
</div>
@@ -40,7 +42,8 @@ class Note{
this.element.css({
'width': this.width + 'px',
'height': this.height + 'px',
'position': 'relative'
'position': 'relative',
'z-index': this.zindex
});
this.element.on( "dblclick", function() {
openModalEditNote(parseInt($(this).attr('data-id')));