Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent usage of $(document.body) instead of $('body') #25671

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const Dropdown = (($) => {
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement &&
$(parent).closest(Selector.NAVBAR_NAV).length === 0) {
$('body').children().on('mouseover', null, $.noop)
$(document.body).children().on('mouseover', null, $.noop)
}

this._element.focus()
Expand Down Expand Up @@ -365,7 +365,7 @@ const Dropdown = (($) => {
// If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
$('body').children().off('mouseover', null, $.noop)
$(document.body).children().off('mouseover', null, $.noop)
}

toggles[i].setAttribute('aria-expanded', 'false')
Expand Down
8 changes: 4 additions & 4 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ const Modal = (($) => {

// Adjust body padding
const actualPadding = document.body.style.paddingRight
const calculatedPadding = $('body').css('padding-right')
$('body').data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
const calculatedPadding = $(document.body).css('padding-right')
$(document.body).data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
}
}

Expand All @@ -476,9 +476,9 @@ const Modal = (($) => {
})

// Restore body padding
const padding = $('body').data('padding-right')
const padding = $(document.body).data('padding-right')
if (typeof padding !== 'undefined') {
$('body').css('padding-right', padding).removeData('padding-right')
$(document.body).css('padding-right', padding).removeData('padding-right')
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ const Tooltip = (($) => {
// only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement) {
$('body').children().on('mouseover', null, $.noop)
$(document.body).children().on('mouseover', null, $.noop)
}

const complete = () => {
Expand Down Expand Up @@ -375,7 +375,7 @@ const Tooltip = (($) => {
// If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
$('body').children().off('mouseover', null, $.noop)
$(document.body).children().off('mouseover', null, $.noop)
}

this._activeTrigger[Trigger.CLICK] = false
Expand Down