{"size": 611, "ext": "js", "max_stars_repo_path": "src/devtools/js/state/menu.js", "max_stars_repo_name": "seanvfs/grids-and-rulers", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/devtools/js/state/menu.js", "max_issues_repo_name": "seanvfs/grids-and-rulers", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/devtools/js/state/menu.js", "max_forks_repo_name": "seanvfs/grids-and-rulers", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.1578947368, "max_line_length": 79, "alphanum_fraction": 0.5286415712}
import AppManager from '../state.js'

// Base DOM actions for the tabs UI
// ----------------------------------------------------------------------------
function switchTab (e) {
  const hash = new URL(e.target.href).hash

  AppManager.state.tabs.forEach(tab => {
    tab.active = tab.link === hash
  })

  AppManager.tabs.update()
}

// We attach tehe event handler directly on the tab object because
// we know we will never have to serialize those objects with JSON
// ----------------------------------------------------------------------------
AppManager.state.tabs.forEach(tab => tab.onclick = switchTab)
