summaryrefslogtreecommitdiff
path: root/bundle.js
diff options
context:
space:
mode:
Diffstat (limited to 'bundle.js')
-rw-r--r--bundle.js37
1 files changed, 18 insertions, 19 deletions
diff --git a/bundle.js b/bundle.js
index fd554b0..e5dd4b8 100644
--- a/bundle.js
+++ b/bundle.js
@@ -30014,8 +30014,9 @@ function add(i, j) {
} else {
div.addEventListener("touchstart", function (e) {
e.preventDefault();
- toggle(note);
- erasing = !note.playing;
+ trigger(note);
+ // erasing = !note.playing;
+ dragging = true;
lastNote = note;
});
}
@@ -30046,11 +30047,7 @@ function bind() {
var note = notes[x][y];
if (note !== lastNote) {
if (dragging) {
- if (erasing) {
- pause(note);
- } else {
- toggle(note);
- }
+ trigger(note);
}
lastNote = note;
}
@@ -30068,18 +30065,20 @@ function bind() {
document.querySelector("#help-button").addEventListener("click", function () {
return document.querySelector("#help").classList.toggle("visible");
});
- grid.addEventListener("wheel", function (e) {
- var new_base_x = Math.max(0, base_x + e.deltaX / 32);
- var new_base_y = Math.max(0, base_y + e.deltaY / 32);
- if (Math.round(base_x) !== Math.round(new_base_x) || Math.round(base_y) !== Math.round(new_base_y)) {
- base_x = new_base_x;
- base_y = new_base_y;
- rebuild();
- } else {
- base_x = new_base_x;
- base_y = new_base_y;
- }
- });
+ if (_util.browser.isDesktop) {
+ grid.addEventListener("wheel", function (e) {
+ var new_base_x = Math.max(0, base_x + e.deltaX / 32);
+ var new_base_y = Math.max(0, base_y + e.deltaY / 32);
+ if (Math.round(base_x) !== Math.round(new_base_x) || Math.round(base_y) !== Math.round(new_base_y)) {
+ base_x = new_base_x;
+ base_y = new_base_y;
+ rebuild();
+ } else {
+ base_x = new_base_x;
+ base_y = new_base_y;
+ }
+ });
+ }
}
var isReset = false;