Created
April 29, 2012 23:06
-
-
Save connor/2553777 to your computer and use it in GitHub Desktop.
use shiftDiff var instead of numeric value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 37: // left | |
if (d3.event.shiftKey && focus > shiftDiff) context.focus(focus -= shiftDiff); | |
else { | |
if (focus == null) focus = size - 1; | |
if (focus > 0) context.focus(--focus); | |
} | |
break; | |
case 39: // right | |
if (d3.event.shiftKey && size - focus > shiftDiff) context.focus(focus += shiftDiff); | |
else { | |
if (focus == null) focus = size - 2; | |
if (focus < size - 1) context.focus(focus++); | |
} | |
break; | |
default: return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment