Skip to content

Allow dynamic reconfiguration. #30

@hellige

Description

@hellige

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions