aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMartijn Cuppens <[email protected]>2018-02-21 09:01:02 +0100
committerJohann-S <[email protected]>2018-02-21 09:01:02 +0100
commit8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac (patch)
tree20def81d65fa792c478db7cf6814977d52b3078b /js
parent99379f3843ddd5bd66ce6559ab91ef68c744fbd7 (diff)
downloadbootstrap-8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac.tar.xz
bootstrap-8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac.zip
Consistent usage of $(document.body) instead of $('body') (#25671)
Diffstat (limited to 'js')
-rw-r--r--js/src/dropdown.js4
-rw-r--r--js/src/modal.js8
-rw-r--r--js/src/tooltip.js4
3 files changed, 8 insertions, 8 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index b877017f2..2f6929854 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -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()
@@ -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')
diff --git a/js/src/modal.js b/js/src/modal.js
index 9237944df..2ca56e7e2 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -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`)
}
}
@@ -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')
}
}
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 65d9c2201..861f45a86 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -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 = () => {
@@ -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