Skip to content

Instantly share code, notes, and snippets.

@Fannon
Created January 24, 2015 07:48
Show Gist options
  • Save Fannon/fe946ed9ce9c0dd3efac to your computer and use it in GitHub Desktop.
Save Fannon/fe946ed9ce9c0dd3efac to your computer and use it in GitHub Desktop.
// Once the document has finished loading, set up everything!
jQuery(document).ready(function() {
// Check if a SemanticForm is present
if ($('#sfForm').length > 0) {
jQuery('body').initializeJSElements();
jQuery('.multipleTemplateInstance').initializeJSElements(true);
jQuery('.multipleTemplateAdder').click( function() {
jQuery(this).addInstance( false );
});
jQuery('.multipleTemplateList').sortable({
axis: 'y',
handle: '.instanceRearranger'
});
$(window).bind('beforeunload', function(){
return 'Are you sure you want to leave?';
});
// If the form is submitted, validate everything!
jQuery('#sfForm').submit( function() {return validateAll();} );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment