Skip to content

Commit

Permalink
👷 build v2.0.3
Browse files Browse the repository at this point in the history
⬆️ jQuery Bridget v2.0.1, asNavFor v2.0.1
  • Loading branch information
desandro committed Aug 16, 2016
1 parent 67f4f56 commit e69be66
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 31 deletions.
2 changes: 1 addition & 1 deletion css/flickity.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Flickity v2.0.2
/*! Flickity v2.0.3
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 v2.0.2
/*! Flickity v2.0.3
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.

60 changes: 37 additions & 23 deletions dist/flickity.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Flickity PACKAGED v2.0.2
* Flickity PACKAGED v2.0.3
* Touch, responsive, flickable carousels
*
* Licensed GPLv3 for open source use
Expand All @@ -11,20 +11,19 @@

/**
* Bridget makes jQuery widgets
* v2.0.0
* v2.0.1
* MIT license
*/

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

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

// universal module definition
/*jshint strict: false */ /* globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) {
factory( window, jQuery );
return factory( window, jQuery );
});
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS
Expand Down Expand Up @@ -1228,6 +1227,13 @@ function Flickity( element, options ) {
return;
}
this.element = queryElement;
// do not initialize twice on same element
if ( this.element.flickityGUID ) {
var instance = instances[ this.element.flickityGUID ];
instance.option( options );
return instance;
}

// add jQuery
if ( jQuery ) {
this.$element = jQuery( this.element );
Expand Down Expand Up @@ -2680,6 +2686,7 @@ proto._childUIPointerDownDrag = function( event ) {
var cursorNodes = {
TEXTAREA: true,
INPUT: true,
OPTION: true,
};

// input types that do not have text fields
Expand All @@ -2693,7 +2700,7 @@ var clickTypes = {
};

proto.pointerDown = function( event, pointer ) {
// dismiss inputs with text fields. #404
// dismiss inputs with text fields. #403, #404
var isCursorInput = cursorNodes[ event.target.nodeName ] &&
!clickTypes[ event.target.type ];
if ( isCursorInput ) {
Expand Down Expand Up @@ -3455,7 +3462,7 @@ proto._createPageDots = function() {
this.on( 'resize', this.updatePageDots );
this.on( 'deactivate', this.deactivatePageDots );

this.pageDots.on( 'pointerDown', function( button, event ) {
this.pageDots.on( 'pointerDown', function( event ) {
this.childUIPointerDown( event );
}.bind( this ));
};
Expand Down Expand Up @@ -4002,7 +4009,7 @@ return Flickity;
}));

/*!
* Flickity v2.0.2
* Flickity v2.0.3
* Touch, responsive, flickable carousels
*
* Licensed GPLv3 for open source use
Expand Down Expand Up @@ -4045,7 +4052,7 @@ return Flickity;
});

/*!
* Flickity asNavFor v2.0.0
* Flickity asNavFor v2.0.1
* enable asNavFor for Flickity
*/

Expand All @@ -4059,26 +4066,22 @@ return Flickity;
define( 'flickity-as-nav-for/as-nav-for',[
'flickity/js/index',
'fizzy-ui-utils/utils'
], function( classie, Flickity, utils ) {
return factory( window, classie, Flickity, utils );
});
], factory );
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS
module.exports = factory(
window,
require('flickity'),
require('fizzy-ui-utils')
);
} else {
// browser global
window.Flickity = factory(
window,
window.Flickity,
window.fizzyUIUtils
);
}

}( window, function factory( window, Flickity, utils ) {
}( window, function factory( Flickity, utils ) {



Expand Down Expand Up @@ -4124,35 +4127,46 @@ proto.setNavCompanion = function( elem ) {
// click
this.on( 'staticClick', this.onNavStaticClick );

this.navCompanionSelect();
this.navCompanionSelect( true );
};

proto.navCompanionSelect = function() {
proto.navCompanionSelect = function( isInstant ) {
if ( !this.navCompanion ) {
return;
}
// select slide that matches first cell of slide
var selectedCell = this.navCompanion.selectedCells[0];
var cellIndex = this.navCompanion.cells.indexOf( selectedCell );
this.selectCell( cellIndex );
var firstIndex = this.navCompanion.cells.indexOf( selectedCell );
var lastIndex = firstIndex + this.navCompanion.selectedCells.length - 1;
var selectIndex = Math.floor( lerp( firstIndex, lastIndex,
this.navCompanion.cellAlign ) );
this.selectCell( selectIndex, false, isInstant );
// set nav selected class
this.removeNavSelectedElements();
// stop if companion has more cells than this one
if ( cellIndex >= this.cells.length ) {
if ( selectIndex >= this.cells.length ) {
return;
}
this.navSelectedElements = this.slides[ this.selectedIndex ].getCellElements();

var selectedCells = this.cells.slice( firstIndex, lastIndex + 1 );
this.navSelectedElements = selectedCells.map( function( cell ) {
return cell.element;
});
this.changeNavSelectedClass('add');
};

function lerp( a, b, t ) {
return ( b - a ) * t + a;
}

proto.changeNavSelectedClass = function( method ) {
this.navSelectedElements.forEach( function( navElem ) {
navElem.classList[ method ]('is-nav-selected');
});
};

proto.activateAsNavFor = function() {
this.navCompanionSelect();
this.navCompanionSelect( true );
};

proto.removeNavSelectedElements = function() {
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 v2.0.2
* Flickity v2.0.3
* Touch, responsive, flickable carousels
*
* 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": "2.0.2",
"version": "2.0.3",
"description": "Touch, responsive, flickable carousels",
"main": "js/index.js",
"style": "css/flickity.css",
Expand Down

0 comments on commit e69be66

Please sign in to comment.