Skip to content

Commit

Permalink
More use of teenyicons
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Nov 19, 2020
1 parent 4e207dc commit b85a169
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
23 changes: 19 additions & 4 deletions client/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed) {
var h = '<div id="' + id + '" class="card ' + colour +
' draggable" style="-webkit-transform:rotate(' + rot +
'deg);\
">\
<img src="images/icons/token/Xion.png" class="card-icon delete-card-icon" />\
">\
<svg class="card-icon delete-card-icon" width="15" height="15"><use xlink:href="teenyicons/teenyicons-outline-sprite.svg#outline--x-circle" /></svg>\
<img class="card-image" src="images/' +
colour + '-card.png">\
<div id="content:' + id +
Expand Down Expand Up @@ -213,6 +213,15 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed) {
return;
}

if ($(event.target).hasClass("stuck-sticker"))
{
//You're dragging a sticker on the card, not the card itself
//so do not move the card
//console.log(event);
if(event.offsetX > 20) console.log('delete!');
return;
}

var data = {
id: this.id,
position: ui.position,
Expand Down Expand Up @@ -332,14 +341,20 @@ function addSticker(cardId, stickerId) {
if (Array.isArray(stickerId)) {
for (var i in stickerId) {
stickerContainer.prepend('<img src="images/stickers/' + stickerId[i] +
'.png">');
'.png" class="stuck-sticker">');
}
} else {
if (stickerContainer.html().indexOf(stickerId) < 0)
stickerContainer.prepend('<img src="images/stickers/' + stickerId +
'.png">');
'.png" class="stuck-sticker">');
}

$(".stuck-sticker").draggable({
revert: true,
zIndex: 1000,
cursor: "pointer",
});

}


Expand Down
6 changes: 4 additions & 2 deletions views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ block body
table#board-table.board-table
tr
td#icon-col(width='1%')
image#add-col.col-icon(width='20', height='20', src='images/icons/iconic/raster/black/plus_alt_32x32.png')
image#delete-col.col-icon(width='20', height='20', src='images/icons/iconic/raster/black/minus_alt_32x32.png')
svg#add-col.col-icon(width='20', height='20')
<use xlink:href="teenyicons/teenyicons-outline-sprite.svg#outline--plus-circle" />
svg#delete-col.col-icon(width='20', height='20')
<use xlink:href="teenyicons/teenyicons-outline-sprite.svg#outline--minus-circle" />


div.buttons
Expand Down

0 comments on commit b85a169

Please sign in to comment.