WIP - no love for minified.js anymore :(

This commit is contained in:
Keegan
2016-01-28 20:20:43 -08:00
parent 9da9edbb78
commit 04f2f9dabd
7 changed files with 62 additions and 27 deletions
+20 -8
View File
@@ -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();