aboutsummaryrefslogtreecommitdiff
path: root/js/src/carousel.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-07-08 20:09:39 +0300
committerXhmikosR <[email protected]>2020-09-21 14:58:34 +0300
commitb31046aab36ea1e476ff384f585ef650c8158d1e (patch)
tree1f88c461bb248b1dd8876a106e16a52996329822 /js/src/carousel.js
parentc86b74fe88318cd4483c148a560742b0d2ed6f65 (diff)
downloadbootstrap-b31046aab36ea1e476ff384f585ef650c8158d1e.tar.xz
bootstrap-b31046aab36ea1e476ff384f585ef650c8158d1e.zip
Cache a few variables.
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 8c03818ab..62b4ce1e4 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -129,10 +129,11 @@ class Carousel {
}
nextWhenVisible() {
+ const $element = $(this._element)
// Don't call next when the page isn't visible
// or the carousel or its parent isn't visible
if (!document.hidden &&
- ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {
+ ($element.is(':visible') && $element.css('visibility') !== 'hidden')) {
this.next()
}
}