"use strict"; (function($, window, i) { // Bootstrap 4 Modal $.fn.fireModal = function(options) { var options = $.extend({ size: 'modal-md', center: false, animation: true, title: 'Modal Title', closeButton: true, header: true, bodyClass: '', footerClass: '', body: '', buttons: [], autoFocus: true, created: function() {}, appended: function() {}, onFormSubmit: function() {}, modal: {} }, options); this.each(function() { i++; var id = 'fire-modal-' + i, trigger_class = 'trigger--' + id, trigger_button = $('.' + trigger_class); $(this).addClass(trigger_class); // Get modal body let body = options.body; if(typeof body == 'object') { if(body.length) { let part = body; body = body.removeAttr('id').clone().removeClass('modal-part'); part.remove(); }else{ body = '