Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2015-08-15 22:10:24 +0300
committerJacob Thornton <jacobthornton@gmail.com>2015-08-15 22:10:24 +0300
commitc830956d17d23acf5f5a177db5509bd87f1473c3 (patch)
tree491e9ecd85f0f979e30188392bb9bf62fe4610ae /js/dist/modal.js
parentdb14bac42fcac97df5e1b11ab14f8907a3c3c2a9 (diff)
change modal.js to use is-fixed classes to target padding-right
Diffstat (limited to 'js/dist/modal.js')
-rw-r--r--js/dist/modal.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/dist/modal.js b/js/dist/modal.js
index ef33f10103..b467c40f05 100644
--- a/js/dist/modal.js
+++ b/js/dist/modal.js
@@ -57,6 +57,7 @@ var Modal = (function ($) {
};
var ClassName = {
+ SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
BACKDROP: 'modal-backdrop',
OPEN: 'modal-open',
FADE: 'fade',
@@ -67,7 +68,7 @@ var Modal = (function ($) {
DIALOG: '.modal-dialog',
DATA_TOGGLE: '[data-toggle="modal"]',
DATA_DISMISS: '[data-dismiss="modal"]',
- SCROLLBAR_MEASURER: 'modal-scrollbar-measure'
+ FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'
};
/**
@@ -417,7 +418,7 @@ var Modal = (function ($) {
}, {
key: '_setScrollbar',
value: function _setScrollbar() {
- var bodyPadding = parseInt($(document.body).css('padding-right') || 0, 10);
+ var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
this._originalBodyPadding = document.body.style.paddingRight || '';
@@ -435,7 +436,7 @@ var Modal = (function ($) {
value: function _getScrollbarWidth() {
// thx d.walsh
var scrollDiv = document.createElement('div');
- scrollDiv.className = Selector.SCROLLBAR_MEASURER;
+ scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
document.body.appendChild(scrollDiv);
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);