Created
March 1, 2016 14:14
-
-
Save bastianallgeier/9398bbd72dcc782827a8 to your computer and use it in GitHub Desktop.
Panel Field JS Boilerplate
This file contains hidden or 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
(function($) { | |
$.fn.myfield = function() { | |
return this.each(function() { | |
var field = $(this); | |
// avoid multiple inits | |
if(field.data('myfield')) { | |
return true; | |
} else { | |
field.data('myfield', true); | |
} | |
// your field plugin code | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment