Skip to content

Instantly share code, notes, and snippets.

@gauntface
Created December 27, 2012 17:01
Show Gist options
  • Save gauntface/4389904 to your computer and use it in GitHub Desktop.
Save gauntface/4389904 to your computer and use it in GitHub Desktop.
Focus Controller - Change focus to a new item.
/**
* This method performs a change of focus to the item index
* @param {int} itemIndex
*/
this.handleFocusChangeToItem = function (itemIndex) {
if(currentlyFocusedItem) {
currentlyFocusedItem.setFocusState(false);
}
var focusableItem = this.getFocusableItem(itemIndex);
focusableItem.setFocusState(true);
currentlyFocusedItem = focusableItem;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment