Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dynamic reconfiguration. #30

Open
hellige opened this issue Feb 24, 2015 · 0 comments
Open

Allow dynamic reconfiguration. #30

hellige opened this issue Feb 24, 2015 · 0 comments

Comments

@hellige
Copy link

hellige commented Feb 24, 2015

It would be nice to have a programmatic way of replacing the configuration and re-adapting the page. I've hacked my own copy to allow this, but I'm not sure whether the approach would be accepted as a pull request...

Basically, I made the following changes:

  1. remove the aliasing of the config object's fields so that changed to ADAPT_CONFIG will be picked
    up.
  2. bind a global window.adapt variable to allow the client code to call adapt() after changing the
    config.

Obviously, this whole thing could also be accomplished by wrapping the above in a reconfigure() method, which would allow the aliasing to be restored, too, but it would still require binding a global, which adapt currently doesn't.

If binding a global is a concern, it would be possible, I suppose to do that only if the initial config contains bindGlobal: true or something like that.

Anyway, I'd be happy to submit a pull request for this if there's any interest at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant