mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
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:
committed by
GitHub
parent
9eb05c4ad3
commit
9ab746e143
@@ -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]);
|
||||
|
||||
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user