1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-15 01:55:46 +02:00

fix(modal): removes .navbar-toggler margin

This commit is contained in:
Catalin Zalog
2018-03-01 10:30:47 +02:00
committed by Johann-S
parent abb4868626
commit cb82394fc8
2 changed files with 3 additions and 55 deletions

View File

@@ -64,8 +64,7 @@ const Modal = (($) => {
DATA_TOGGLE : '[data-toggle="modal"]',
DATA_DISMISS : '[data-dismiss="modal"]',
FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
STICKY_CONTENT : '.sticky-top',
NAVBAR_TOGGLER : '.navbar-toggler'
STICKY_CONTENT : '.sticky-top'
}
/**
@@ -452,15 +451,6 @@ const Modal = (($) => {
.css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)
})
// Adjust navbar-toggler margin
$(navbarToggler).each((index, element) => {
const actualMargin = element.style.marginRight
const calculatedMargin = $(element).css('margin-right')
$(element)
.data('margin-right', actualMargin)
.css('margin-right', `${parseFloat(calculatedMargin) + this._scrollbarWidth}px`)
})
// Adjust body padding
const actualPadding = document.body.style.paddingRight
const calculatedPadding = $(document.body).css('padding-right')
@@ -482,8 +472,8 @@ const Modal = (($) => {
}
})
// Restore sticky content and navbar-toggler margin
const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}, ${Selector.NAVBAR_TOGGLER}`))
// Restore sticky content
const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))
$(elements).each((index, element) => {
const margin = $(element).data('margin-right')
if (typeof margin !== 'undefined') {