Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created March 1, 2016 14:14
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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