Permalink
Browse files

Fix for QH calling keyUp callback on mouseOut when mouseButton is up

  • Loading branch information...
1 parent 6bca917 commit 3c15037ffec1c7d54906253ad40c84baab1a1dc0 @doubledare doubledare committed Oct 28, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 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));
+ }
});
}
}

0 comments on commit 3c15037

Please sign in to comment.