cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@chromium.org>
Subject Changing config.xml settings at runtime
Date Sun, 10 Feb 2013 19:01:58 GMT
First - I'd like to add yet another setting for iOS:

KeyboardShrinksView (boolean).

It applies to apps that position their elements relative to the bottom of
the webview. When the keyboard comes up, I'd like to shrink the webview
rather than shrink the viewport and have the page scrollable. This is the
default behaviour on Android, and makes a lot of sense when building apps
as opposed to webpages.


But... Reason for this email, is I think it'd be useful to have a
x-platform API for changing the settings within config.xml at runtime.
Something like:

cordova.setConfigValue(key, value)

An example of the keyboard case:
app.onPageChange = function(pageName) {
  cordova.setConfigValue('KeyboardShrinksView', pageName != 'help');
};

And I suppose adding a getter makes sense:
cordova.getConfigValues(successCallback)

I'm thinking that setting these at runtime will *not* persist across app
restarts to avoid the issue of what should happen when devs push updates to
their apps that change settings around.

If everyone's okay with this, I'll file a bug & sub-bugs per-platform.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message