Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/index.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/index.js b/src/index.js
index 90404d9..bc4f138 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,8 +1,8 @@
import PanZoom from './modules/panzoom.js';
import Game from './modules/game.js';
-const RecordSheet = new function () {
- this.unSelect = function () {
+const RecordSheet = {
+ unSelect: function () {
let selected = this.getSelected();
if (selected) {
@@ -10,19 +10,19 @@ const RecordSheet = new function () {
}
document.getElementById('toggle-prone-counter').checked = false;
- };
+ },
- this.getSelected = function () {
+ getSelected: function () {
return document.querySelector('.soldier-record.selected');
- };
+ },
- this.select = function (data) {
+ select: function (data) {
this.unSelect();
document.querySelector(`#record-sheet .soldier-record[data-number="${data.number}"][data-allegiance="${data.allegiance}"]`).classList.add('selected');
document.getElementById('toggle-prone-counter').checked = data.prone;
- };
+ },
- this.endMove = function() {
+ endMove: function() {
const selected = this.getSelected();
if (selected) {
@@ -30,7 +30,7 @@ const RecordSheet = new function () {
}
this.unSelect();
- };
+ }
};
const mapPlaceholder = document.querySelector('.map-placeholder');