mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 00:24:03 +02:00
fix(modal): fix unit test and resetting style
This commit is contained in:
@@ -431,7 +431,6 @@ const Modal = (($) => {
|
|||||||
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||||
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
||||||
const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))
|
const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))
|
||||||
const navbarToggler = [].slice.call(document.querySelectorAll(Selector.NAVBAR_TOGGLER))
|
|
||||||
|
|
||||||
// Adjust fixed content padding
|
// Adjust fixed content padding
|
||||||
$(fixedContent).each((index, element) => {
|
$(fixedContent).each((index, element) => {
|
||||||
@@ -465,11 +464,8 @@ const Modal = (($) => {
|
|||||||
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
||||||
$(fixedContent).each((index, element) => {
|
$(fixedContent).each((index, element) => {
|
||||||
const padding = $(element).data('padding-right')
|
const padding = $(element).data('padding-right')
|
||||||
if (typeof padding !== 'undefined') {
|
$(element).removeData('padding-right')
|
||||||
$(element)
|
element.style.paddingRight = padding ? padding : ''
|
||||||
.css('padding-right', padding)
|
|
||||||
.removeData('padding-right')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Restore sticky content
|
// Restore sticky content
|
||||||
@@ -483,9 +479,8 @@ const Modal = (($) => {
|
|||||||
|
|
||||||
// Restore body padding
|
// Restore body padding
|
||||||
const padding = $(document.body).data('padding-right')
|
const padding = $(document.body).data('padding-right')
|
||||||
if (typeof padding !== 'undefined') {
|
$(document.body).removeData('padding-right')
|
||||||
$(document.body).css('padding-right', padding).removeData('padding-right')
|
document.body.style.paddingRight = padding ? padding : ''
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_getScrollbarWidth() { // thx d.walsh
|
_getScrollbarWidth() { // thx d.walsh
|
||||||
|
@@ -21,7 +21,8 @@ $(function () {
|
|||||||
document.body.removeChild(scrollDiv)
|
document.body.removeChild(scrollDiv)
|
||||||
return scrollbarWidth
|
return scrollbarWidth
|
||||||
}
|
}
|
||||||
// Simulate scrollbars in PhantomJS
|
|
||||||
|
// Simulate scrollbars
|
||||||
$('html').css('padding-right', '16px')
|
$('html').css('padding-right', '16px')
|
||||||
},
|
},
|
||||||
beforeEach: function () {
|
beforeEach: function () {
|
||||||
|
Reference in New Issue
Block a user