Another attempt at testing for PointerEvent. (#1870)

Advanced compilation error introduced in #1856.
Now bypassing window altogether, by testing goog.global.PointerEvent directly.
This commit is contained in:
Andrew n marshall
2018-05-15 17:12:53 -07:00
committed by GitHub
parent 9eb05c4ad3
commit 9ab746e143
2 changed files with 2 additions and 4 deletions

View File

@@ -464,8 +464,7 @@ Blockly.bindEventWithChecks_ = function(node, name, thisObject, func,
};
var bindData = [];
var window = goog.global['window'];
if (window && window.PointerEvent && (name in Blockly.Touch.TOUCH_MAP)) {
if (goog.global.PointerEvent && (name in Blockly.Touch.TOUCH_MAP)) {
for (var i = 0, type; type = Blockly.Touch.TOUCH_MAP[name][i]; i++) {
node.addEventListener(type, wrapFunc, false);
bindData.push([node, type, wrapFunc]);

View File

@@ -48,8 +48,7 @@ Blockly.Touch.touchIdentifier_ = null;
* @type {Object}
*/
Blockly.Touch.TOUCH_MAP = {};
var window = goog.global['window'];
if (window && window.PointerEvent) {
if (goog.global.PointerEvent) {
Blockly.Touch.TOUCH_MAP = {
'mousedown': ['pointerdown'],
'mouseenter': ['pointerenter'],