embla-carousel-class-names
Advanced tools
Comparing version 7.0.9 to 7.1.0
@@ -8,3 +8,3 @@ import { ClassNamesOptionsType, OptionsType } from './Options'; | ||
} | ||
export declare type ClassNamesType = CreatePluginType<{}, OptionsType>; | ||
export type ClassNamesType = CreatePluginType<{}, OptionsType>; | ||
declare function ClassNames(userOptions?: ClassNamesOptionsType): ClassNamesType; | ||
@@ -11,0 +11,0 @@ declare namespace ClassNames { |
import { CreateOptionsType } from 'embla-carousel/components/Options'; | ||
export declare type OptionsType = CreateOptionsType<{ | ||
export type OptionsType = CreateOptionsType<{ | ||
selected: string; | ||
@@ -8,2 +8,2 @@ draggable: string; | ||
export declare const defaultOptions: OptionsType; | ||
export declare type ClassNamesOptionsType = Partial<OptionsType>; | ||
export type ClassNamesOptionsType = Partial<OptionsType>; |
@@ -35,3 +35,2 @@ 'use strict'; | ||
var draggingEvents = ['pointerDown', 'pointerUp']; | ||
function init(embla) { | ||
@@ -43,7 +42,5 @@ carousel = embla; | ||
var isDraggable = carousel.internalEngine().options.draggable; | ||
if (isDraggable) { | ||
addClass(root, options.draggable); | ||
} | ||
if (options.dragging) { | ||
@@ -54,3 +51,2 @@ draggingEvents.forEach(function (evt) { | ||
} | ||
if (options.selected) { | ||
@@ -63,3 +59,2 @@ selectedEvents.forEach(function (evt) { | ||
} | ||
function destroy() { | ||
@@ -77,7 +72,5 @@ removeClass(root, options.draggable); | ||
} | ||
function toggleDraggingClass(evt) { | ||
if (evt === 'pointerDown') addClass(root, options.dragging);else removeClass(root, options.dragging); | ||
} | ||
function toggleSelectedClass() { | ||
@@ -93,3 +86,2 @@ var inView = carousel.slidesInView(true); | ||
} | ||
var self = { | ||
@@ -103,3 +95,2 @@ name: 'classNames', | ||
} | ||
ClassNames.globalOptions = undefined; | ||
@@ -106,0 +97,0 @@ |
@@ -29,3 +29,2 @@ import EmblaCarousel from 'embla-carousel'; | ||
var draggingEvents = ['pointerDown', 'pointerUp']; | ||
function init(embla) { | ||
@@ -37,7 +36,5 @@ carousel = embla; | ||
var isDraggable = carousel.internalEngine().options.draggable; | ||
if (isDraggable) { | ||
addClass(root, options.draggable); | ||
} | ||
if (options.dragging) { | ||
@@ -48,3 +45,2 @@ draggingEvents.forEach(function (evt) { | ||
} | ||
if (options.selected) { | ||
@@ -57,3 +53,2 @@ selectedEvents.forEach(function (evt) { | ||
} | ||
function destroy() { | ||
@@ -71,7 +66,5 @@ removeClass(root, options.draggable); | ||
} | ||
function toggleDraggingClass(evt) { | ||
if (evt === 'pointerDown') addClass(root, options.dragging);else removeClass(root, options.dragging); | ||
} | ||
function toggleSelectedClass() { | ||
@@ -87,3 +80,2 @@ var inView = carousel.slidesInView(true); | ||
} | ||
var self = { | ||
@@ -97,3 +89,2 @@ name: 'classNames', | ||
} | ||
ClassNames.globalOptions = undefined; | ||
@@ -100,0 +91,0 @@ |
{ | ||
"name": "embla-carousel-class-names", | ||
"version": "7.0.9", | ||
"version": "7.1.0", | ||
"author": "David Jerleke", | ||
@@ -58,4 +58,4 @@ "description": "A class name toggle plugin for Embla Carousel", | ||
"peerDependencies": { | ||
"embla-carousel": "7.0.9" | ||
"embla-carousel": "7.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26852