add email form to game over screen
This commit is contained in:
@@ -55,6 +55,9 @@ KeyboardInputManager.prototype.listen = function () {
|
||||
event.shiftKey;
|
||||
var mapped = map[event.which];
|
||||
|
||||
// Ignore the event if it's happening in a text field
|
||||
if (self.targetIsInput(event)) return;
|
||||
|
||||
if (!modifiers) {
|
||||
if (mapped !== undefined) {
|
||||
event.preventDefault();
|
||||
@@ -79,8 +82,9 @@ KeyboardInputManager.prototype.listen = function () {
|
||||
|
||||
gameContainer.addEventListener(this.eventTouchstart, function (event) {
|
||||
if ((!window.navigator.msPointerEnabled && event.touches.length > 1) ||
|
||||
event.targetTouches > 1) {
|
||||
return; // Ignore if touching with more than 1 finger
|
||||
event.targetTouches > 1 ||
|
||||
self.targetIsInput(event)) {
|
||||
return; // Ignore if touching with more than 1 finger or touching input
|
||||
}
|
||||
|
||||
if (window.navigator.msPointerEnabled) {
|
||||
@@ -100,8 +104,9 @@ KeyboardInputManager.prototype.listen = function () {
|
||||
|
||||
gameContainer.addEventListener(this.eventTouchend, function (event) {
|
||||
if ((!window.navigator.msPointerEnabled && event.touches.length > 0) ||
|
||||
event.targetTouches > 0) {
|
||||
return; // Ignore if still touching with one or more fingers
|
||||
event.targetTouches > 0 ||
|
||||
self.targetIsInput(event)) {
|
||||
return; // Ignore if still touching with one or more fingers or input
|
||||
}
|
||||
|
||||
var touchEndClientX, touchEndClientY;
|
||||
@@ -142,3 +147,7 @@ KeyboardInputManager.prototype.bindButtonPress = function (selector, fn) {
|
||||
button.addEventListener("click", fn.bind(this));
|
||||
button.addEventListener(this.eventTouchend, fn.bind(this));
|
||||
};
|
||||
|
||||
KeyboardInputManager.prototype.targetIsInput = function (event) {
|
||||
return event.target.tagName.toLowerCase() === "input";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user