Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 9 additions and 5 deletions.
  1. +9 −5 qwerty-hancock.js
14 qwerty-hancock.js
View
@@ -99,8 +99,10 @@
noteDown = false;
keyUpCallback(this.attr('title'), getFrequency(this.attrs.title));
}).mouseout(function () {
- this.attr({fill: whiteNotesColour});
- keyUpCallback(this.attr('title'), getFrequency(this.attrs.title));
+ if (noteDown) {
+ this.attr({fill: whiteNotesColour});
+ keyUpCallback(this.attr('title'), getFrequency(this.attrs.title));
+ }
});
noteCounter++;
@@ -132,12 +134,14 @@
keyDownCallback(this.attr('title'), getFrequency(this.attrs.title));
}
}).mouseup(function () {
- this.attr({fill: blackNotesColour});
+ this.attr({fill: blackNotesColour});
noteDown = false;
keyUpCallback(this.attr('title'), getFrequency(this.attrs.title));
}).mouseout(function () {
- this.attr({fill: blackNotesColour});
- keyUpCallback(this.attr('title'), getFrequency(this.attrs.title));
+ if (noteDown) {
+ this.attr({fill: blackNotesColour});
+ keyUpCallback(this.attr('title'), getFrequency(this.attrs.title));
+ }
});
}
}

No commit comments for this range

Something went wrong with that request. Please try again.