Cental modals and add SweetAlerts
This commit is contained in:
parent
f560020ffd
commit
4b40fa65d4
4 changed files with 19 additions and 1 deletions
15
public/js/admin.min.js
vendored
15
public/js/admin.min.js
vendored
|
@ -1 +1,14 @@
|
|||
$.urlParam=function(name){var results=new RegExp("[\\?&]"+name+"=([^&#]*)").exec(decodeURIComponent(window.location.href));if(results==null){return null}else{return results[1]||0}};function getPageName(url){var index=url.lastIndexOf("/")+1;var filenameWithExtension=url.substr(index);var filename=filenameWithExtension.split(".")[0];return filename}
|
||||
$(document).ready(function () {
|
||||
$.urlParam=function(name){var results=new RegExp("[\\?&]"+name+"=([^&#]*)").exec(decodeURIComponent(window.location.href));if(results==null){return null}else{return results[1]||0}};function getPageName(url){var index=url.lastIndexOf("/")+1;var filenameWithExtension=url.substr(index);var filename=filenameWithExtension.split(".")[0];return filename}
|
||||
function centerModal(element) {
|
||||
var modal = (element.length > 0) ? element : $('.modal:visible');
|
||||
var clone = modal.clone().css('display', 'block').appendTo('body');
|
||||
var top = Math.round((clone.height() - clone.find('.modal-content').height()) / 3);
|
||||
clone.remove();
|
||||
modal.find('div.modal-content').css('margin-top', top);
|
||||
}
|
||||
$('body').on('show.bs.modal', '.modal', function() {
|
||||
centerModal($(this));
|
||||
});
|
||||
$(window).on('resize', centerModal);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue