react-image-gallery
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -155,2 +155,28 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ImageGallery = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
_getAlignment: function(index) { | ||
var currentIndex = this.state.currentIndex; | ||
var alignment = ''; | ||
switch (index) { | ||
case (currentIndex - 1): | ||
alignment = 'left'; | ||
break; | ||
case (currentIndex): | ||
alignment = 'center'; | ||
break; | ||
case (currentIndex + 1): | ||
alignment = 'right'; | ||
break; | ||
} | ||
if (index === 0 && currentIndex === this.props.items.length - 1) { | ||
// set first slide as right slide if were sliding right from last slide | ||
alignment = 'right'; | ||
} else if (index === this.props.items.length - 1 && currentIndex === 0) { | ||
// set last slide as left slide if were sliding left from first slide | ||
alignment = 'left'; | ||
} | ||
return alignment; | ||
}, | ||
render: function() { | ||
@@ -185,18 +211,3 @@ var currentIndex = this.state.currentIndex; | ||
this.props.items.map(function(item, index) { | ||
var alignment = ''; | ||
switch (index) { | ||
case (currentIndex - 1): | ||
alignment = 'left'; | ||
break; | ||
case (currentIndex): | ||
alignment = 'center'; | ||
break; | ||
case (currentIndex + 1): | ||
alignment = 'right'; | ||
break; | ||
} | ||
var alignment = this._getAlignment(index); | ||
return ( | ||
@@ -203,0 +214,0 @@ React.createElement("div", { |
{ | ||
"name": "react-image-gallery", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Image gallery component for React.JS", | ||
@@ -5,0 +5,0 @@ "main": "./build/image-gallery", |
@@ -15,3 +15,3 @@ # react-image-gallery | ||
To build the examples locally, run: | ||
To build the example locally, run: | ||
@@ -18,0 +18,0 @@ ``` |
@@ -154,2 +154,28 @@ 'use strict'; | ||
_getAlignment: function(index) { | ||
var currentIndex = this.state.currentIndex; | ||
var alignment = ''; | ||
switch (index) { | ||
case (currentIndex - 1): | ||
alignment = 'left'; | ||
break; | ||
case (currentIndex): | ||
alignment = 'center'; | ||
break; | ||
case (currentIndex + 1): | ||
alignment = 'right'; | ||
break; | ||
} | ||
if (index === 0 && currentIndex === this.props.items.length - 1) { | ||
// set first slide as right slide if were sliding right from last slide | ||
alignment = 'right'; | ||
} else if (index === this.props.items.length - 1 && currentIndex === 0) { | ||
// set last slide as left slide if were sliding left from first slide | ||
alignment = 'left'; | ||
} | ||
return alignment; | ||
}, | ||
render: function() { | ||
@@ -184,18 +210,3 @@ var currentIndex = this.state.currentIndex; | ||
this.props.items.map(function(item, index) { | ||
var alignment = ''; | ||
switch (index) { | ||
case (currentIndex - 1): | ||
alignment = 'left'; | ||
break; | ||
case (currentIndex): | ||
alignment = 'center'; | ||
break; | ||
case (currentIndex + 1): | ||
alignment = 'right'; | ||
break; | ||
} | ||
var alignment = this._getAlignment(index); | ||
return ( | ||
@@ -202,0 +213,0 @@ <div |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38751
817