Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-img-carousel

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-img-carousel - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

22

lib/index.js

@@ -556,2 +556,3 @@ 'use strict';

onMouseLeave: this.onMouseLeave,
onMouseOver: this.onMouseOver,
onMouseEnter: this.onMouseEnter,

@@ -904,2 +905,12 @@ onTouchStart: this.onTouchStart

value: function onMouseEnter() {
document.addEventListener('mousemove', this.handleMovement, false);
}
/**
* Invoked when the mouse cursor moves around a slide.
*/
}, {
key: 'handleMovement',
value: function handleMovement() {
this.setHoverState(true);

@@ -909,2 +920,12 @@ }

/**
* Invoked when the mouse cursor moves over a slide.
*/
}, {
key: 'onMouseOver',
value: function onMouseOver() {
this.setHoverState(true);
}
/**
* Keeps track of the current hover state.

@@ -947,2 +968,3 @@ *

value: function onMouseLeave() {
document.removeEventListener('mousemove', this.handleMovement, false);
this.setHoverState(false);

@@ -949,0 +971,0 @@ !this._animating && this.stopDragging();

2

package.json
{
"name": "react-img-carousel",
"version": "1.2.4",
"version": "1.2.5",
"description": "Provides an image carousel React component.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -413,2 +413,3 @@ import React, { PropTypes, Component, Children, cloneElement } from 'react';

onMouseLeave={ this.onMouseLeave }
onMouseOver={ this.onMouseOver }
onMouseEnter={ this.onMouseEnter }

@@ -726,2 +727,9 @@ onTouchStart={ this.onTouchStart }

onMouseEnter () {
document.addEventListener('mousemove', this.handleMovement, false);
}
/**
* Invoked when the mouse cursor moves around a slide.
*/
handleMovement () {
this.setHoverState(true);

@@ -731,2 +739,9 @@ }

/**
* Invoked when the mouse cursor moves over a slide.
*/
onMouseOver () {
this.setHoverState(true);
}
/**
* Keeps track of the current hover state.

@@ -758,2 +773,3 @@ *

onMouseLeave () {
document.removeEventListener('mousemove', this.handleMovement, false);
this.setHoverState(false);

@@ -760,0 +776,0 @@ !this._animating && this.stopDragging();

@@ -21,3 +21,2 @@ import React from 'react';

describe('Carousel', () => {
beforeEach(() => {

@@ -218,2 +217,22 @@ imagesFetched = [];

it('should pause when mouse is moving', done => {
const carousel = renderToJsdom(
<Carousel slideWidth='300px' viewportWidth='300px' infinite={ false } autoplay={ true } pauseOnHover={ true }>
<div id='slide1' />
<div id='slide2' />
<div id='slide3' />
</Carousel>
);
setImmediate(() => {
const track = document.querySelector('.carousel-viewport');
const setHoverState = (bool) => {
expect(bool).to.be.true;
done();
};
carousel.setHoverState = setHoverState;
carousel.handleMovement(track);
});
});
it('should navigate to the last slide when a right swipe event occurs on the first slide', done => {

@@ -220,0 +239,0 @@ const carousel = renderToJsdom(

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc