mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-30 13:56:58 -04:00
WIP - no love for minified.js anymore :(
This commit is contained in:
@@ -12,14 +12,26 @@ var customFn = window.customFn || function() {};
|
||||
var $mainForm = $('#main-form');
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm);
|
||||
|
||||
function submit(event) {
|
||||
// Set the return URL depending on the runtime environment
|
||||
location.href =
|
||||
returnTo + encodeURIComponent(JSON.stringify(clayConfig.getSettings()));
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
clayConfig.on(clayConfig.EVENTS.BEFORE_BUILD, function() {
|
||||
// attach components here
|
||||
});
|
||||
|
||||
$mainForm.on('|submit', submit);
|
||||
clayConfig.on(clayConfig.EVENTS.AFTER_BUILD, function() {
|
||||
var self = this;
|
||||
|
||||
// add listeners here
|
||||
$mainForm.on('|submit', function(event) {
|
||||
// Set the return URL depending on the runtime environment
|
||||
location.href =
|
||||
returnTo + encodeURIComponent(JSON.stringify(self.getSettings()));
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// Run the custom function in the context of the ClayConfig
|
||||
customFn.call(clayConfig);
|
||||
|
||||
// Now that we have given the dev's custom code to run and attach listeners,
|
||||
// we build the config
|
||||
clayConfig.build();
|
||||
|
||||
Reference in New Issue
Block a user