Created
January 24, 2015 07:48
-
-
Save Fannon/fe946ed9ce9c0dd3efac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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