Socket
Socket
Sign inDemoInstall

swiper

Package Overview
Dependencies
Maintainers
1
Versions
333
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiper - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

src/utils/document.js

7

CHANGELOG.md
# Change Log
## [Swiper 4.0.3](https://github.com/nolimits4web/swiper/compare/v4.0.2...v4.0.5) - Released on October 27, 2017
* Fixed Parallax opacity and scale transitions
* Better compatability with SSR by using dummy `document` object
* Fixed styles for dynamic pagination buttons in RTL mode
* Fixed issue with last pagination button not being active with `slidesPerView: 'auto'`
* Renamed build tasks: `build-dev` -> `build:dev`, `build-prod` -> `build:prod`
## [Swiper 4.0.2](https://github.com/nolimits4web/swiper/compare/v4.0.1...v4.0.2) - Released on October 18, 2017

@@ -4,0 +11,0 @@ * Lazy loading support for Virtual slides

6

package.json
{
"name": "swiper",
"version": "4.0.2",
"version": "4.0.3",
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",

@@ -9,4 +9,4 @@ "main": "dist/js/swiper.js",

"scripts": {
"build-dev": "NODE_ENV=development gulp build",
"build-prod": "NODE_ENV=production gulp build",
"build:dev": "NODE_ENV=development gulp build",
"build:prod": "NODE_ENV=production gulp build",
"dev": "NODE_ENV=development gulp build && NODE_ENV=development gulp playground && NODE_ENV=development gulp server",

@@ -13,0 +13,0 @@ "prod": "NODE_ENV=production gulp playground && NODE_ENV=production gulp server",

[![Join the chat at https://gitter.im/nolimits4web/Swiper](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nolimits4web/Swiper)
[![Build Status](https://travis-ci.org/nolimits4web/Swiper.svg?branch=master)](https://travis-ci.org/nolimits4web/Swiper)
[![devDependency Status](https://david-dm.org/nolimits4web/swiper/dev-status.svg)](https://david-dm.org/nolimits4web/swiper#info=devDependencies)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/swiper/badge?style=rounded)](https://www.jsdelivr.com/package/npm/swiper)

@@ -40,3 +41,3 @@ Swiper

```
$ npm run build-dev
$ npm run build:dev
```

@@ -49,3 +50,3 @@

```
$ npm run build-prod
$ npm run build:prod
```

@@ -52,0 +53,0 @@

@@ -0,1 +1,2 @@

import document from '../../../utils/document';
import Device from '../../../utils/device';

@@ -2,0 +3,0 @@ import Support from '../../../utils/support';

@@ -0,1 +1,2 @@

import document from '../../../utils/document';
import $ from '../../../utils/dom';

@@ -2,0 +3,0 @@ import Utils from '../../../utils/utils';

@@ -0,1 +1,2 @@

import document from '../../../utils/document';
import $ from '../../../utils/dom';

@@ -2,0 +3,0 @@ import Device from '../../../utils/device';

@@ -0,1 +1,2 @@

import document from '../../../utils/document';
import $ from '../../../utils/dom';

@@ -2,0 +3,0 @@

@@ -40,5 +40,4 @@ import Browser from '../../../utils/browser';

// Update Index
swiper.updateActiveIndex(slideIndex);
if ((rtl && -translate === swiper.translate) || (!rtl && translate === swiper.translate)) {
swiper.updateActiveIndex(slideIndex);
// Update Height

@@ -54,10 +53,10 @@ if (params.autoHeight) {

}
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks);
if (speed === 0 || Browser.lteIE9) {
swiper.setTransition(0);
swiper.setTranslate(translate);
swiper.updateActiveIndex(slideIndex);
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks);
swiper.transitionEnd(runCallbacks);

@@ -67,2 +66,6 @@ } else {

swiper.setTranslate(translate);
swiper.updateActiveIndex(slideIndex);
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks);
if (!swiper.animating) {

@@ -69,0 +72,0 @@ swiper.animating = true;

@@ -6,3 +6,3 @@ import Utils from '../../../utils/utils';

const translate = swiper.rtl ? swiper.translate : -swiper.translate;
const { slidesGrid, snapGrid, params, activeIndex: previousIndex, realIndex: previousRealIndex } = swiper;
const { slidesGrid, snapGrid, params, activeIndex: previousIndex, realIndex: previousRealIndex, snapIndex: previousSnapIndex } = swiper;
let activeIndex = newActiveIndex;

@@ -27,7 +27,13 @@ let snapIndex;

}
snapIndex = Math.floor(activeIndex / params.slidesPerGroup);
if (snapGrid.indexOf(translate) >= 0) {
snapIndex = snapGrid.indexOf(translate);
} else {
snapIndex = Math.floor(activeIndex / params.slidesPerGroup);
}
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
if (activeIndex === previousIndex) {
if (snapIndex !== previousSnapIndex) {
swiper.snapIndex = snapIndex;
swiper.emit('snapIndexChange');
}
return;

@@ -34,0 +40,0 @@ }

import window from '../../utils/window';
import document from '../../utils/document';
import $ from '../../utils/dom';

@@ -3,0 +4,0 @@ import Utils from '../../utils/utils';

import window from '../../utils/window';
import document from '../../utils/document';
import $ from '../../utils/dom';

@@ -3,0 +4,0 @@ import Utils from '../../utils/utils';

import window from '../../utils/window';
import document from '../../utils/document';
import $ from '../../utils/dom';

@@ -3,0 +4,0 @@ import Utils from '../../utils/utils';

@@ -8,2 +8,3 @@ import $ from '../../utils/dom';

const swiper = this;
const rtl = swiper.rtl;
const params = swiper.params.pagination;

@@ -73,3 +74,4 @@ if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;

const bulletsOffset = (((swiper.pagination.bulletSize * 5) - (swiper.pagination.bulletSize)) / 2) - (current * swiper.pagination.bulletSize);
bullets.css(swiper.isHorizontal() ? 'left' : 'top', `${bulletsOffset}px`);
const offsetProp = rtl ? 'right' : 'left';
bullets.css(swiper.isHorizontal() ? offsetProp : 'top', `${bulletsOffset}px`);
}

@@ -76,0 +78,0 @@ }

@@ -40,7 +40,7 @@ import $ from '../../utils/dom';

if (typeof pOpacity !== 'undefined' && opacity !== null) {
if (typeof opacity !== 'undefined' && opacity !== null) {
const currentOpacity = opacity - ((opacity - 1) * (1 - Math.abs(progress)));
$el[0].style.opacity = currentOpacity;
}
if (typeof pScale === 'undefined' || scale === null) {
if (typeof scale === 'undefined' || scale === null) {
$el.transform(`translate3d(${x}, ${y}, 0px)`);

@@ -47,0 +47,0 @@ } else {

import window from './window';
import document from './document';

@@ -3,0 +4,0 @@ const Browser = (function Browser() {

import window from './window';
import document from './document';

@@ -3,0 +4,0 @@ const Device = (function Device() {

import window from './window';
import document from './document';

@@ -3,0 +4,0 @@ const Support = (function Support() {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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