diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-07-20 10:58:42 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-07-20 10:58:42 -0400 |
commit | 68db9abc7a02c78a0f170003c32d1fcd796eb212 (patch) | |
tree | 602e9be8f4641991a9666315426a8ca10807c78c /scripts/cards | |
parent | 5207f04d5b775bf4805d83c81aaad1cfcf3fe68a (diff) |
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
Diffstat (limited to 'scripts/cards')
-rw-r--r-- | scripts/cards/deck.js | 4 | ||||
-rw-r--r-- | scripts/cards/drag.js | 6 |
2 files changed, 5 insertions, 5 deletions
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]; |