flickity-imagesloaded
Advanced tools
Comparing version 1.0.4 to 2.0.0
{ | ||
"name": "flickity-imagesloaded", | ||
"main": "flickity-imagesloaded.js", | ||
"version": "1.0.4", | ||
"dependencies": { | ||
"flickity": "^1.0.0", | ||
"imagesloaded": "^3.1.8" | ||
"flickity": "^2.0.0", | ||
"imagesloaded": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"qunit": "~1.17.1" | ||
"qunit": "^2.0.0" | ||
}, | ||
@@ -17,7 +16,2 @@ "homepage": "https://github.com/metafizzy/flickity-imagesloaded", | ||
"description": "Enable imagesLoaded option for Flickity", | ||
"moduleType": [ | ||
"amd", | ||
"globals", | ||
"node" | ||
], | ||
"keywords": [ | ||
@@ -24,0 +18,0 @@ "flickity", |
/*! | ||
* Flickity imagesLoaded v1.0.4 | ||
* Flickity imagesLoaded v2.0.0 | ||
* enables imagesLoaded option for Flickity | ||
@@ -9,6 +9,4 @@ */ | ||
( 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 ) { | ||
@@ -22,3 +20,3 @@ // AMD | ||
}); | ||
} else if ( typeof exports == 'object' ) { | ||
} else if ( typeof module == 'object' && module.exports ) { | ||
// CommonJS | ||
@@ -44,7 +42,9 @@ module.exports = factory( | ||
Flickity.prototype._createImagesLoaded = function() { | ||
var proto = Flickity.prototype; | ||
proto._createImagesLoaded = function() { | ||
this.on( 'activate', this.imagesLoaded ); | ||
}; | ||
Flickity.prototype.imagesLoaded = function() { | ||
proto.imagesLoaded = function() { | ||
if ( !this.options.imagesLoaded ) { | ||
@@ -51,0 +51,0 @@ return; |
{ | ||
"name": "flickity-imagesloaded", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"description": "Enable imagesLoaded option for Flickity", | ||
"main": "flickity-imagesloaded.js", | ||
"dependencies": { | ||
"flickity": "^1.0.0", | ||
"imagesloaded": "^3.1.8" | ||
"flickity": "^2.0.0", | ||
"imagesloaded": "^4.1.0" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
@@ -28,3 +29,6 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"homepage": "https://github.com/metafizzy/flickity-imagesloaded" | ||
"homepage": "https://github.com/metafizzy/flickity-imagesloaded", | ||
"directories": { | ||
"test": "test" | ||
} | ||
} |
@@ -6,3 +6,3 @@ # Flickity imagesLoaded | ||
``` js | ||
var flkty = new Flickity( '.main-gallery', { | ||
var flkty = new Flickity( '.carousel', { | ||
// re-position cells when images load | ||
@@ -25,3 +25,3 @@ imagesLoaded: true | ||
requirejs( [ 'path/to/flickity-imagesloaded' ], function( Flickity ) { | ||
var flkty = new Flickity( '.gallery', { | ||
var flkty = new Flickity( '.carousel', { | ||
imagesLoaded: true | ||
@@ -37,3 +37,3 @@ }); | ||
var flkty = new Flickity( '.gallery', { | ||
var flkty = new Flickity( '.carousel', { | ||
imagesLoaded: true | ||
@@ -40,0 +40,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
test( 'images-in-divs-in-divs', function( assert ) { | ||
QUnit.test( 'images-in-divs-in-divs', function( assert ) { | ||
'use strict'; | ||
@@ -16,9 +16,9 @@ | ||
var cell = flkty.cells[i]; | ||
ok( cell.size.width, 'cell has width' ); | ||
assert.ok( cell.size.width, 'cell has width' ); | ||
var isApprox = isPositionApprox( cell.element.style.left, cell.x ); | ||
ok( isApprox, 'cell ' + i + 'at proper position' ); | ||
assert.ok( isApprox, 'cell ' + i + 'at proper position' ); | ||
cellX += cell.size.width; | ||
} | ||
equal( flkty.viewport.style.height, '140px', 'gallery height set' ); | ||
assert.equal( flkty.viewport.style.height, '140px', 'gallery height set' ); | ||
@@ -25,0 +25,0 @@ done(); |
@@ -1,2 +0,2 @@ | ||
test( 'images-in-divs', function( assert ) { | ||
QUnit.test( 'images-in-divs', function( assert ) { | ||
'use strict'; | ||
@@ -16,9 +16,9 @@ | ||
var cell = flkty.cells[i]; | ||
ok( cell.size.width, 'cell has width' ); | ||
assert.ok( cell.size.width, 'cell has width' ); | ||
var isApprox = isPositionApprox( cell.element.style.left, cell.x ); | ||
ok( isApprox, 'cell ' + i + 'at proper position' ); | ||
assert.ok( isApprox, 'cell ' + i + 'at proper position' ); | ||
cellX += cell.size.width; | ||
} | ||
equal( flkty.viewport.style.height, '140px', 'gallery height set' ); | ||
assert.equal( flkty.viewport.style.height, '140px', 'gallery height set' ); | ||
@@ -25,0 +25,0 @@ done(); |
@@ -1,2 +0,2 @@ | ||
test( 'images', function( assert ) { | ||
QUnit.test( 'images', function( assert ) { | ||
'use strict'; | ||
@@ -16,9 +16,9 @@ | ||
var cell = flkty.cells[i]; | ||
ok( cell.size.width, 'cell has width' ); | ||
assert.ok( cell.size.width, 'cell has width' ); | ||
var isApprox = isPositionApprox( cell.element.style.left, cell.x ); | ||
ok( isApprox, 'cell ' + i + 'at proper position' ); | ||
assert.ok( isApprox, 'cell ' + i + 'at proper position' ); | ||
cellX += cell.size.width; | ||
} | ||
equal( flkty.viewport.style.height, '140px', 'gallery height set' ); | ||
assert.equal( flkty.viewport.style.height, '140px', 'gallery height set' ); | ||
@@ -25,0 +25,0 @@ done(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10803
167
+ Addeddesandro-matches-selector@2.0.2(transitive)
+ Addedev-emitter@1.1.1(transitive)
+ Addedfizzy-ui-utils@2.0.7(transitive)
+ Addedflickity@2.3.0(transitive)
+ Addedget-size@2.0.3(transitive)
+ Addedimagesloaded@4.1.4(transitive)
+ Addedunidragger@2.4.0(transitive)
+ Addedunipointer@2.4.0(transitive)
- Removeddesandro-classie@1.0.1(transitive)
- Removeddesandro-get-style-property@1.0.4(transitive)
- Removeddesandro-matches-selector@1.0.3(transitive)
- Removeddoc-ready@1.0.4(transitive)
- Removedeventie@1.0.6(transitive)
- Removedfizzy-ui-utils@1.0.1(transitive)
- Removedflickity@1.2.1(transitive)
- Removedget-size@1.2.2(transitive)
- Removedimagesloaded@3.2.0(transitive)
- Removedtap-listener@1.1.2(transitive)
- Removedunidragger@1.1.5(transitive)
- Removedunipointer@1.1.0(transitive)
- Removedwolfy87-eventemitter@4.2.11(transitive)
Updatedflickity@^2.0.0
Updatedimagesloaded@^4.1.0