Skip to content

Commit

Permalink
minor changes to stickies example
Browse files Browse the repository at this point in the history
  • Loading branch information
jbakse committed Jan 30, 2022
1 parent bf71df2 commit 5a0b4ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions notes/todo.todo
Expand Up @@ -52,6 +52,8 @@

- Tooling
-- maybe jump to esbuild and/or vite?
-- instead of using naming like demo_m to key eslint to use moduels
could switch to using an eslint config in each example folder

- Contribution Project Ideas
-- Server Admin Panel. Show connected apps/rooms/guests + stats.
Expand Down
7 changes: 4 additions & 3 deletions public/examples/stickies/index.js
Expand Up @@ -40,14 +40,14 @@ function setup() {

if (partyIsHost()) {
shared.items = [];
shared.items.push(initItem(new Point(100, 100), "#ffff66", "untitled"));
shared.items.push(initItem(new Point(100, 100), "#ffff66", "untitled 1"));
}

const createItemSubmit = document.getElementById("create-item-submit");
createItemSubmit.addEventListener("click", createItem);
createItemSubmit.addEventListener("click", onCreateItem);
}

function createItem() {
function onCreateItem() {
const label = document.getElementById("create-item-label").value;
if (!label) return;
document.getElementById("create-item-label").value = "";
Expand Down Expand Up @@ -118,6 +118,7 @@ function drawItem(item) {
}

function mousePressedItem(item) {
// @todo this probably needs a guard against two clients dragging notes at the same time, like drag2
if (pointInRect(new Point(mouseX, mouseY), item.rect)) {
item.inDrag = true;
item.owner = my_id;
Expand Down

0 comments on commit 5a0b4ba

Please sign in to comment.