修改Bootstrap弹框不垂直居中问题
This commit is contained in:
parent
53b79a6c85
commit
8454c184b1
|
@ -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);
|
})(jQuery);
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap v3.3.7 (http://getbootstrap.com)
|
* Bootstrap v3.3.7 (http://getbootstrap.com)
|
||||||
* Copyright 2011-2016 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under the MIT license
|
* Licensed under the MIT license
|
||||||
|
@ -1163,10 +1163,6 @@ if (typeof jQuery === 'undefined') {
|
||||||
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
||||||
paddingRight: 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Modal.prototype.resetAdjustments = function () {
|
Modal.prototype.resetAdjustments = function () {
|
||||||
|
|
Loading…
Reference in New Issue