Skip to content

Instantly share code, notes, and snippets.

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