(function(global, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory();
} else {
global.ObjectExample = factory();
}
})(this,
function(options) {
function ObjectExample(options) {
var _this = this;
var settings = {
selector: '',
csrf_token: '',
actions: [],
};
if (!options) {
options = {};
}
function deleteOne(element) {
var url = $(element).attr('data-url') || '';
var csrf_token = settings.csrf_token;
}
this.setOptions = function(options) {
for (var key in options) {
if (typeof settings[key] !== 'undefined') {
settings[key] = options[key];
}
}
}
this.listenEvents = function() {
var selector = settings.selector;
var actions = settings.actions;
if (actions.indexOf('deleteOne') !== -1) {
console.log('deleteOne');
$(selector).find('.dropdown-menu .delete-one-btn').on('click',
function(event) {
deleteOne(this);
});
}
}
this.setOptions(options);
}
return ObjectExample;
});