Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created March 1, 2016 14:14
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastianallgeier/9398bbd72dcc782827a8 to your computer and use it in GitHub Desktop.
Save bastianallgeier/9398bbd72dcc782827a8 to your computer and use it in GitHub Desktop.
Panel Field JS Boilerplate
(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