You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keymaster.js
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -264,11 +264,13 @@
264
264
};
265
265
266
266
// set the handlers globally on document
267
-
addEvent(document,'keydown',function(event){dispatch(event)});// Passing _scope to a callback to ensure it remains the same by execution. Fixes #48
268
-
addEvent(document,'keyup',clearModifier);
269
-
270
-
// reset modifiers to false whenever the window is (re)focused.
271
-
addEvent(window,'focus',resetModifiers);
267
+
if(typeofwindow!=='undefined'&&window.document){
268
+
addEvent(window.document,'keydown',function(event){dispatch(event)});// Passing _scope to a callback to ensure it remains the same by execution. Fixes #48
269
+
addEvent(window.document,'keyup',clearModifier);
270
+
271
+
// reset modifiers to false whenever the window is (re)focused.
0 commit comments