Skip to content

Commit

Permalink
👷 build v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Mar 18, 2016
1 parent 28b9dbc commit 8a527e5
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 84 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ See [flickity.metafizzy.co](http://flickity.metafizzy.co) for complete docs and
Link directly to [Flickity files on cdnjs](https://cdnjs.com/libraries/flickity).

``` html
<link rel="stylesheet" href="https://npmcdn.com/flickity@1.1/dist/flickity.pkgd.css">
<link rel="stylesheet" href="https://npmcdn.com/flickity@1.2/dist/flickity.pkgd.css">
<!-- or -->
<link rel="stylesheet" href="https://npmcdn.com/flickity@1.1/dist/flickity.pkgd.min.css">
<link rel="stylesheet" href="https://npmcdn.com/flickity@1.2/dist/flickity.pkgd.min.css">
```

``` html
<script src="https://npmcdn.com/flickity@1.1/dist/flickity.pkgd.js"></script>
<script src="https://npmcdn.com/flickity@1.2/dist/flickity.pkgd.js"></script>
<!-- or -->
<script src="https://npmcdn.com/flickity@1.1/dist/flickity.pkgd.min.js"></script>
<script src="https://npmcdn.com/flickity@1.2/dist/flickity.pkgd.min.js"></script>
```

### Package managers
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flickity",
"version": "1.1.2",
"version": "1.2.0",
"description": "Touch, responsive, flickable galleries",
"main": [
"js/index.js",
Expand Down
2 changes: 1 addition & 1 deletion css/flickity.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Flickity v1.1.2
/*! Flickity v1.2.0
http://flickity.metafizzy.co
---------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion dist/flickity.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Flickity v1.1.2
/*! Flickity v1.2.0
http://flickity.metafizzy.co
---------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion dist/flickity.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 43 additions & 71 deletions dist/flickity.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Flickity PACKAGED v1.1.2
* Flickity PACKAGED v1.2.0
* Touch, responsive, flickable galleries
*
* Licensed GPLv3 for open source use
Expand Down Expand Up @@ -3408,8 +3408,7 @@ function preventDefaultEvent( event ) {
// ----- defaults ----- //

utils.extend( Flickity.defaults, {
draggable: true,
touchVerticalScroll: true
draggable: true
});

// ----- create ----- //
Expand Down Expand Up @@ -3516,59 +3515,21 @@ Flickity.prototype.pointerDownFocus = function( event ) {

// ----- move ----- //

Flickity.prototype.pointerMove = function( event, pointer ) {
var moveVector = this._dragPointerMove( event, pointer );
this.touchVerticalScrollMove( event, pointer, moveVector );
this._dragMove( event, pointer, moveVector );
this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] );
};

Flickity.prototype.hasDragStarted = function( moveVector ) {
return !this.isTouchScrolling && Math.abs( moveVector.x ) > 3;
return Math.abs( moveVector.x ) > 3;
};

// ----- up ----- //

Flickity.prototype.pointerUp = function( event, pointer ) {
delete this.isTouchScrolling;
classie.remove( this.viewport, 'is-pointer-down' );
this.dispatchEvent( 'pointerUp', event, [ pointer ] );
this._dragPointerUp( event, pointer );
};

// -------------------------- vertical scroll -------------------------- //

var touchScrollEvents = {
// move events
// mousemove: true,
touchmove: true,
MSPointerMove: true
};

// position of pointer, relative to window
function getPointerWindowY( pointer ) {
var pointerPoint = Unidragger.getPointerPoint( pointer );
return pointerPoint.y - window.pageYOffset;
}

Flickity.prototype.touchVerticalScrollMove = function( event, pointer, moveVector ) {
// do not scroll if already dragging, if disabled
var touchVerticalScroll = this.options.touchVerticalScroll;
// if touchVerticalScroll is 'withDrag', allow scrolling and dragging
var canNotScroll = touchVerticalScroll == 'withDrag' ? !touchVerticalScroll :
this.isDragging || !touchVerticalScroll;
if ( canNotScroll || !touchScrollEvents[ event.type ] ) {
return;
}
// don't start vertical scrolling until pointer has moved 10 pixels in a direction
if ( !this.isTouchScrolling && Math.abs( moveVector.y ) > 10 ) {
// start touch vertical scrolling
// scroll & pointerY when started
this.startScrollY = window.pageYOffset;
this.pointerWindowStartY = getPointerWindowY( pointer );
// start scroll animation
this.isTouchScrolling = true;
}
Flickity.prototype.pointerDone = function() {
eventie.unbind( window, 'scroll', this );
delete this.pointerDownScroll;
};

// -------------------------- dragging -------------------------- //
Expand Down Expand Up @@ -3726,17 +3687,16 @@ return Flickity;
}));

/*!
* Tap listener v1.1.1
* Tap listener v1.1.2
* listens to taps
* MIT license
*/

/*jshint browser: true, unused: true, undef: true, strict: true */

( function( window, factory ) {
/*global define: false, module: false, require: false */
'use strict';
// universal module definition
/*jshint strict: false*/ /*globals define, module, require */

if ( typeof define == 'function' && define.amd ) {
// AMD
Expand All @@ -3763,15 +3723,6 @@ return Flickity;



// handle IE8 prevent default
function preventDefaultEvent( event ) {
if ( event.preventDefault ) {
event.preventDefault();
} else {
event.returnValue = false;
}
}

// -------------------------- TapListener -------------------------- //

function TapListener( elem ) {
Expand Down Expand Up @@ -3802,23 +3753,18 @@ TapListener.prototype.unbindTap = function() {
delete this.tapElement;
};

var pointerDown = TapListener.prototype.pointerDown;

TapListener.prototype.pointerDown = function( event ) {
// prevent default event for touch, disables tap then click
if ( event.type == 'touchstart' ) {
preventDefaultEvent( event );
}
pointerDown.apply( this, arguments );
};

var isPageOffset = window.pageYOffset !== undefined;
/**
* pointer up
* @param {Event} event
* @param {Event or Touch} pointer
*/
TapListener.prototype.pointerUp = function( event, pointer ) {
// ignore emulated mouse up clicks
if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {
return;
}

var pointerPoint = Unipointer.getPointerPoint( pointer );
var boundingRect = this.tapElement.getBoundingClientRect();
// standard or IE8 scroll positions
Expand All @@ -3833,6 +3779,15 @@ TapListener.prototype.pointerUp = function( event, pointer ) {
if ( isInside ) {
this.emitEvent( 'tap', [ event, pointer ] );
}

// set flag for emulated clicks 300ms after touchend
if ( event.type != 'mouseup' ) {
this.isIgnoringMouseUp = true;
// reset flag after 300ms
setTimeout( function() {
delete this.isIgnoringMouseUp;
}.bind( this ), 320 );
}
};

TapListener.prototype.destroy = function() {
Expand Down Expand Up @@ -3930,6 +3885,8 @@ PrevNextButton.prototype._create = function() {
// init as disabled
this.disable();

element.setAttribute( 'aria-label', this.isPrevious ? 'previous' : 'next' );

Flickity.setUnselectable( element );
// create arrow
if ( supportsInlineSVG() ) {
Expand Down Expand Up @@ -4449,10 +4406,24 @@ Flickity.prototype.activatePlayer = function() {
this.isMouseenterBound = true;
};

// Player API, don't hate the ... thanks I know where the door is

Flickity.prototype.playPlayer = function() {
this.player.play();
};

Flickity.prototype.stopPlayer = function() {
this.player.stop();
};

Flickity.prototype.pausePlayer = function() {
this.player.pause();
};

Flickity.prototype.unpausePlayer = function() {
this.player.unpause();
};

Flickity.prototype.deactivatePlayer = function() {
this.player.stop();
if ( this.isMouseenterBound ) {
Expand Down Expand Up @@ -4646,7 +4617,8 @@ Flickity.prototype.cellChange = function( changedCellIndex, isPositioningSlider
if ( this.options.freeScroll ) {
// shift x by change in slideableWidth
// TODO fix position shifts when prepending w/ freeScroll
this.x += prevSlideableWidth - this.slideableWidth;
var deltaX = prevSlideableWidth - this.slideableWidth;
this.x += deltaX * this.cellAlign;
this.positionSlider();
} else {
// do not position slider after lazy load
Expand Down Expand Up @@ -4791,7 +4763,7 @@ return Flickity;
}));

/*!
* Flickity v1.1.2
* Flickity v1.2.0
* Touch, responsive, flickable galleries
*
* Licensed GPLv3 for open source use
Expand Down Expand Up @@ -4835,7 +4807,7 @@ return Flickity;
});

/*!
* Flickity asNavFor v1.0.2
* Flickity asNavFor v1.0.3
* enable asNavFor for Flickity
*/

Expand Down Expand Up @@ -5359,7 +5331,7 @@ function makeArray( obj ) {
});

/*!
* Flickity imagesLoaded v1.0.2
* Flickity imagesLoaded v1.0.4
* enables imagesLoaded option for Flickity
*/

Expand Down
6 changes: 3 additions & 3 deletions dist/flickity.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Flickity v1.1.2
* Flickity v1.2.0
* Touch, responsive, flickable galleries
*
* Licensed GPLv3 for open source use
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flickity",
"version": "1.1.2",
"version": "1.2.0",
"description": "Touch, responsive, flickable galleries",
"main": "js/index.js",
"style": "css/flickity.css",
Expand Down

0 comments on commit 8a527e5

Please sign in to comment.