From 68db9abc7a02c78a0f170003c32d1fcd796eb212 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Wed, 20 Jul 2022 10:58:42 -0400 Subject: Replace var with let + visual tweaks - Replace var with let in most of my code - No longer bring cards to forfront of deck when hovering - Tweaks for dropdown selector input --- scripts/cards/deck.js | 4 ++-- scripts/cards/drag.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/cards') diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js index 8d38186..8c8e3a7 100644 --- a/scripts/cards/deck.js +++ b/scripts/cards/deck.js @@ -117,7 +117,7 @@ class Deck { if(index1 < 0 || index1 >= this.cards.length || index2 < 0 || index2 >= this.cards.length) return - var temp = this.cards[index1] + let temp = this.cards[index1] this.cards[index1] = this.cards[index2]; this.cards[index2] = temp; @@ -168,7 +168,7 @@ class Deck { isInside(x, y) { - var rect = this.e.getBoundingClientRect(); + let rect = this.e.getBoundingClientRect(); return (x > rect.left && x < rect.right && y > rect.top && y < rect.bottom) } diff --git a/scripts/cards/drag.js b/scripts/cards/drag.js index b24ccb1..fa1ef65 100644 --- a/scripts/cards/drag.js +++ b/scripts/cards/drag.js @@ -58,7 +58,7 @@ class MultiDrag extends EventTarget { if(e.button != 0) return; - var cap = new Event("dragstart"); + let cap = new Event("dragstart"); cap.drag = this.addDragEl( e.target, @@ -81,7 +81,7 @@ class MultiDrag extends EventTarget { if (i < 0 || i >= this.drag.length) return; - var cap = new Event("dragstop"); + let cap = new Event("dragstop"); cap.x = this.mouse[0]; cap.y = this.mouse[1]; @@ -112,7 +112,7 @@ class MultiDrag extends EventTarget { this.del = true; - var cap = new Event("dragstop"); + let cap = new Event("dragstop"); cap.x = this.mouse[0]; cap.y = this.mouse[1]; -- cgit v1.2.3