JSFiddle - React, Tailwind, and code Playground
by adeneo
JavaScript
function Plugin(elements, options) {
'use strict';
return this.init(elements, options);
}
if (typeof module === 'object') {
module.exports = Plugin;
}
(function (window, document) {
'use strict';
Plugin.prototype = {
init: function() {
this.insertDiv()
},
defaults: {
showFlag: false,
indent: true
},
insertDiv: function(parentElement){
console.log('crap')
},
insertCustomData: function(parentElement){
//some jquery code
this.insertDiv(parentElement);
},
};
}(window, document));
Plugin.prototype.insertDiv = function() {
console.log('something else');
}
var plugin = new Plugin('test', {showFlag: true, indent:false});