Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Defer setting of scope in setScope #49

Merged
merged 1 commit into from

2 participants

@okonet

... to prevent potential loop or calling callbacks from different scope for the same shortcut. Fixes #28. Fixes #48

@okonet okonet 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
5782b14
@madrobby madrobby merged commit c588df1 into madrobby:master
@madrobby
Owner

Would be great if you can add tests for this, so we don't break it later.

@okonet

Hey Thomas,

I've found a better solution for this one. Also added tests. See #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 13, 2012
  1. @okonet

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

    okonet authored
    …ng callbacks from different scope for the same shortcut. Fixes #28. Fixes #48
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  keymaster.js
View
2  keymaster.js
@@ -141,7 +141,7 @@
for(k in _MODIFIERS) assignKey[k] = false;
// set current scope (default 'all')
- function setScope(scope){ _scope = scope || 'all' };
+ function setScope(scope){ setTimeout(function(){ _scope = scope || 'all' }, 0) };
function getScope(){ return _scope || 'all' };
// delete all handlers for a given scope
Something went wrong with that request. Please try again.