Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2018-10-16 12:10:29 +0300
committerXhmikosR <xhmikosr@gmail.com>2018-10-20 15:32:09 +0300
commitb1dc6b324c33bc6a4b0cb2dc06939136e32d0e0c (patch)
tree4d6bf5747a6b072aef3f14e0d1bab796b7b11a5d /js/src/carousel.js
parent8883ccb205abfe975b4cacca8fbc22cf67092eb0 (diff)
avoid drag img
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 3507a81594..989390aa0a 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -64,6 +64,7 @@ const Event = {
POINTERUP : `pointerup${EVENT_KEY}`,
POINTERLEAVE : `pointerleave${EVENT_KEY}`,
POINTERCANCEL : `pointercancel${EVENT_KEY}`,
+ DRAG_START : `dragstart${EVENT_KEY}`,
LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
}
@@ -84,6 +85,7 @@ const Selector = {
ACTIVE : '.active',
ACTIVE_ITEM : '.active.carousel-item',
ITEM : '.carousel-item',
+ ITEM_IMG : '.carousel-item img',
NEXT_PREV : '.carousel-item-next, .carousel-item-prev',
INDICATORS : '.carousel-indicators',
DATA_SLIDE : '[data-slide], [data-slide-to]',
@@ -323,6 +325,7 @@ class Carousel {
}
}
+ $(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, (e) => e.preventDefault())
if (this._pointerEvent) {
$(this._element).on(Event.POINTERDOWN, (event) => start(event))
$(this._element).on(Event.POINTERUP, (event) => end(event))