mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-11 18:02:28 +03:00
util: change isRTL to a function (#32446)
This allows the bundler to tree-shake the function.
This commit is contained in:
+4
-4
@@ -253,7 +253,7 @@ class Carousel extends BaseComponent {
|
||||
|
||||
// swipe left
|
||||
if (direction > 0) {
|
||||
if (isRTL) {
|
||||
if (isRTL()) {
|
||||
this.next()
|
||||
} else {
|
||||
this.prev()
|
||||
@@ -262,7 +262,7 @@ class Carousel extends BaseComponent {
|
||||
|
||||
// swipe right
|
||||
if (direction < 0) {
|
||||
if (isRTL) {
|
||||
if (isRTL()) {
|
||||
this.prev()
|
||||
} else {
|
||||
this.next()
|
||||
@@ -350,14 +350,14 @@ class Carousel extends BaseComponent {
|
||||
|
||||
if (event.key === ARROW_LEFT_KEY) {
|
||||
event.preventDefault()
|
||||
if (isRTL) {
|
||||
if (isRTL()) {
|
||||
this.next()
|
||||
} else {
|
||||
this.prev()
|
||||
}
|
||||
} else if (event.key === ARROW_RIGHT_KEY) {
|
||||
event.preventDefault()
|
||||
if (isRTL) {
|
||||
if (isRTL()) {
|
||||
this.prev()
|
||||
} else {
|
||||
this.next()
|
||||
|
||||
Reference in New Issue
Block a user