Skip to content

Instantly share code, notes, and snippets.

@tuukka
Created August 12, 2013 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuukka/6209464 to your computer and use it in GitHub Desktop.
Save tuukka/6209464 to your computer and use it in GitHub Desktop.
draft of how local_config.coffee could work in the navigator
citynavi.update_configs
defaults:
...
helsinki:
...
overrides:
...
citynavi.set_config "helsinki"
citynavi.update_configs = (configs) ->
for key, config in configs
citynavi.configs[key] = _.extend (citynavi.configs[key] or {}), config
# reload current config
if citynavi.config.id
citynavi.set_config(citynavi.config.id)
citynavi.set_config = (id) ->
citynavi.config = _.extend {}, citynavi.configs.defaults, citynavi.configs[id], citynavi.configs.overrides
citynavi.config.id = id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment