Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Defer setting of scope in setScope #49

Merged
merged 1 commit into from

2 participants

Andrey Okonetchnikov Thomas Fuchs
Andrey Okonetchnikov

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

Andrey Okonetchnikov 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
Thomas Fuchs madrobby merged commit c588df1 into from
Thomas Fuchs
Owner

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

Andrey Okonetchnikov

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. Andrey Okonetchnikov

    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
2  keymaster.js
View
@@ -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.