mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-31 22:36:56 -04:00
make Clay work with phone apps
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var $ = require('./vendor/minified/minified').$;
|
||||
var _ = require('./vendor/minified/minified')._;
|
||||
var minified = require('./vendor/minified');
|
||||
var ClayConfig = require('./lib/clay-config');
|
||||
var config = _.extend([], window.clayConfig || []);
|
||||
|
||||
var $ = minified.$;
|
||||
var _ = minified._;
|
||||
|
||||
var config = _.extend([], window.clayConfig || []);
|
||||
var settings = _.extend({}, window.claySettings || {});
|
||||
var returnTo = window.returnTo || 'pebblejs://close#';
|
||||
var customFn = window.customFn || function() {};
|
||||
var clayComponents = window.clayComponents || {};
|
||||
|
||||
_.eachObj(clayComponents, function(key, component) {
|
||||
ClayConfig.registerComponent(component);
|
||||
});
|
||||
|
||||
var $mainForm = $('#main-form');
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm);
|
||||
@@ -27,7 +34,7 @@ clayConfig.on(clayConfig.EVENTS.AFTER_BUILD, function() {
|
||||
});
|
||||
|
||||
// Run the custom function in the context of the ClayConfig
|
||||
customFn.call(clayConfig);
|
||||
customFn.call(clayConfig, minified);
|
||||
|
||||
// Now that we have given the dev's custom code to run and attach listeners,
|
||||
// we build the config
|
||||
|
||||
Reference in New Issue
Block a user