?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec/draft/assets/scripts/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sec/draft/assets/scripts/ui-modals.js |
var UIModals = function () { var initModals = function () { $.fn.modalmanager.defaults.resize = true; $.fn.modalmanager.defaults.spinner = '<div class="loading-spinner fade" style="width: 200px; margin-left: -100px;"><img src="../../../../assets/img/ajax-modal-loading.gif" align="middle"> <span style="font-weight:300; color: #eee; font-size: 18px; font-family:Open Sans;"> Loading...</span></div>'; var $modal = $('#ajax-modal'); $('.modal_ajax_demo_btn').on('click', function(){ // create the backdrop and wait for next modal to be triggered var url = $(this).data('url'); $('body').modalmanager('loading'); setTimeout(function(){ $.ajax({ type: "POST", data : { action : 'add' }, dataType:"json", url: url , success: function(data) { if(data.json_perm==1){ // $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $modal.empty().html(data.json_data); $modal.modal().on("hidden", function() { $modal.empty(); // alert('model closed') }); } else{ $("#view_msg").html(data.json_data); } } }); }, 1000); }); $modal.on('click', '.update', function(){ $modal.modal('loading'); setTimeout(function(){ $modal .modal('loading') .find('.modal-body') .prepend('<div class="alert alert-info fade in">' + 'Updated!<button type="button" class="close" data-dismiss="alert"></button>' + '</div>'); }, 1000); }); } return { //main function to initiate the module init: function () { initModals(); } }; }();