修改Bootstrap弹框不垂直居中问题

This commit is contained in:
Argo-Lenovo 2017-03-16 20:02:30 +08:00
parent 53b79a6c85
commit 8454c184b1
2 changed files with 2391 additions and 2381 deletions

View File

@ -344,6 +344,20 @@
}
}
});
//fix bug
$.fn.modal.Constructor.prototype.adjustDialog = function () {
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
this.$element.css({
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
})
// added by Argo
var $modal_dialog = $(this.$element[0]).find('.modal-dialog');
$modal_dialog.adjustDialog();
}
})(jQuery);
$(function () {

File diff suppressed because it is too large Load Diff