Skip to content

Instantly share code, notes, and snippets.

@micmath
Created May 14, 2010 16:52
Show Gist options
  • Save micmath/401374 to your computer and use it in GitHub Desktop.
Save micmath/401374 to your computer and use it in GitHub Desktop.
var that = this; // this is a CarouselPane
this._focusable.on('beforeActivate', function(e) {
var toActivate = e.toActivateIndex; // index of the item that will become active
if (!that._inMotion) { // the CarouselPane wants to prevent move flooding
that.moveTo(toActivate, {callback: function() { // put the toActivate item in the spotlight
that._focusable.activateItem(toActivate); // now can manually activate the toActivate item
}});
}
return false; // prevent Focusable from making the toActivate item active
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment