js_lis 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -457,25 +457,25 @@ class Layout {
|
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
startDrag(event) {
|
|
460
|
-
isDragging = true;
|
|
461
|
-
offsetX = event.clientX - document.getElementById("keyboard").offsetLeft;
|
|
462
|
-
offsetY = event.clientY - document.getElementById("keyboard").offsetTop;
|
|
460
|
+
this.isDragging = true;
|
|
461
|
+
this.offsetX = event.clientX - document.getElementById("keyboard").offsetLeft;
|
|
462
|
+
this.offsetY = event.clientY - document.getElementById("keyboard").offsetTop;
|
|
463
463
|
|
|
464
464
|
document.addEventListener("mousemove", drag);
|
|
465
465
|
document.addEventListener("mouseup", () => {
|
|
466
|
-
isDragging = false;
|
|
466
|
+
this.isDragging = false;
|
|
467
467
|
document.removeEventListener("mousemove", drag);
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
drag(event) {
|
|
472
|
-
if (isDragging) {
|
|
472
|
+
if (this.isDragging) {
|
|
473
473
|
const keyboard = document.getElementById("keyboard");
|
|
474
474
|
keyboard.style.left = `${event.clientX - offsetX}px`;
|
|
475
475
|
keyboard.style.top = `${event.clientY - offsetY}px`;
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
|
|
478
|
+
|
|
479
479
|
toggleCapsLock() {
|
|
480
480
|
this.isCapsLock = !this.isCapsLock;
|
|
481
481
|
const capsLockKeys = document.querySelectorAll(".capslock");
|
|
@@ -700,4 +700,5 @@ class Layout {
|
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
|
|
703
|
-
|
|
703
|
+
export default Layout;
|
|
704
|
+
|