Skip to content

Instantly share code, notes, and snippets.

@eddymul
Created June 18, 2009 22:13
Show Gist options
  • Save eddymul/132238 to your computer and use it in GitHub Desktop.
Save eddymul/132238 to your computer and use it in GitHub Desktop.
uni_form/media/uni_form/uni-form.jquery.js assumes there's a form.uniForm, and fails when there is none such form.
diff --git a/uni_form/media/uni_form/uni-form.jquery.js b/uni_form/media/uni_fo\
rm/uni-form.jquery.js
index 4746a53..6cfb21f 100644
--- a/uni_form/media/uni_form/uni-form.jquery.js
+++ b/uni_form/media/uni_form/uni-form.jquery.js
@@ -22,6 +22,9 @@ jQuery.fn.uniform = function(settings) {
// Auto set on page load...
$(document).ready(function() {
- jQuery('form.uniForm').uniform();
+ q = jQuery('form.uniForm');
+ if(q.length) {
+ jQuery('form.uniForm').uniform();
+ }
$(document.activeElement).focus() //safari doesn't support this and has no a\
lternative
});
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment