Skip to content

Instantly share code, notes, and snippets.

@dfrho
Created October 20, 2017 19:25
Show Gist options
  • Save dfrho/87a4d145b3a69bfacbbf891aeacb36ae to your computer and use it in GitHub Desktop.
Save dfrho/87a4d145b3a69bfacbbf891aeacb36ae to your computer and use it in GitHub Desktop.
prepNavPanel
function prepNavPanel() {
var boroIDs = ["mh", "bk", "qs", "xb", "si", "all"];
boroIDs.forEach(function (boroID) {
let buttonEl = document.getElementById(boroID);
let id = buttonEl.id;
buttonEl.onclick =
id !== "all"
? function (e) {
e.preventDefault();
filterLocationList(id);
setBoroView(id);
}
: function (e) {
e.preventDefault();
resetLocationList();
setBoroView("all");
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment