Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var renderRouteElement = function(route, i) {
var element = document.createElement('li');
var routeSummary = route.route.summary;
element.innerHTML = renderRouteTitle(routeSummary, i);
element.addEventListener('click', function() {
if (selectedRoute) {
selectedRouteElement.classList.remove('selected');
}
element.classList.add('selected');
selectedRoute = route;
selectedRouteElement = element;
if (options.onRouteSelection) {
options.onRouteSelection(selectedRoute);
}
}, false);
return element;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.