mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-30 22:06:45 -04:00
expose meta containing watch and account info in ClayConfig
This commit is contained in:
@@ -11,6 +11,7 @@ var settings = _.extend({}, window.claySettings || {});
|
||||
var returnTo = window.returnTo || 'pebblejs://close#';
|
||||
var customFn = window.customFn || function() {};
|
||||
var clayComponents = window.clayComponents || {};
|
||||
var clayMeta = window.clayMeta || {};
|
||||
|
||||
var platform = window.navigator.userAgent.match(/android/i) ? 'android' : 'ios';
|
||||
document.documentElement.classList.add('platform-' + platform);
|
||||
@@ -21,7 +22,7 @@ _.eachObj(clayComponents, function(key, component) {
|
||||
});
|
||||
|
||||
var $mainForm = $('#main-form');
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm);
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm, clayMeta);
|
||||
|
||||
// add listeners here
|
||||
$mainForm.on('submit', function() {
|
||||
|
||||
@@ -26,9 +26,10 @@ var manipulators = require('./manipulators');
|
||||
* @param {Object} settings - setting that were set from a previous session
|
||||
* @param {Array|Object} config
|
||||
* @param {M} $rootContainer
|
||||
* @param {Object} meta
|
||||
* @constructor
|
||||
*/
|
||||
function ClayConfig(settings, config, $rootContainer) {
|
||||
function ClayConfig(settings, config, $rootContainer, meta) {
|
||||
var self = this;
|
||||
|
||||
var _settings = _.copyObj(settings);
|
||||
@@ -95,6 +96,8 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
self.meta = meta;
|
||||
|
||||
self.EVENTS = {
|
||||
/**
|
||||
* Called before framework has initialized. This is when you would attach your
|
||||
@@ -183,7 +186,6 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
|
||||
// expose the config to allow developers to update it before the build is run
|
||||
self.config = config;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user