Skip to content
This repository
Browse code

Defer setting of scope in setScope to prevent potential loop or calli…

…ng callbacks from different scope for the same shortcut. Fixes #28. Fixes #48
  • Loading branch information...
commit 5782b14e5e8684cf636580983addfe4184f8acfa 1 parent c61b3fe
Andrey Okonetchnikov okonet authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  keymaster.js
2  keymaster.js
@@ -141,7 +141,7 @@
141 141 for(k in _MODIFIERS) assignKey[k] = false;
142 142
143 143 // set current scope (default 'all')
144   - function setScope(scope){ _scope = scope || 'all' };
  144 + function setScope(scope){ setTimeout(function(){ _scope = scope || 'all' }, 0) };
145 145 function getScope(){ return _scope || 'all' };
146 146
147 147 // delete all handlers for a given scope

0 comments on commit 5782b14

Please sign in to comment.
Something went wrong with that request. Please try again.