mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
config redirect
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
QUnit.test( 'sub-pixel fit', function( assert ) {
|
||||
|
||||
var pckry = new Packery( '#sub-pixel-fit', {
|
||||
itemSelector: '.item',
|
||||
transitionDuration: 0
|
||||
});
|
||||
|
||||
function getItemsTotalY() {
|
||||
var y = 0;
|
||||
for ( var i=0, len = pckry.items.length; i < len; i++ ) {
|
||||
var item = pckry.items[i];
|
||||
y += item.rect.y;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
// iterate over multiple container widths
|
||||
for ( var containerWidth = 290; containerWidth < 310; containerWidth++ ) {
|
||||
pckry.element.style.width = containerWidth + 'px';
|
||||
pckry.layout();
|
||||
assert.equal( 0, getItemsTotalY(), 'items fit at ' + containerWidth + 'px' );
|
||||
}
|
||||
|
||||
// set grid sizer and do it again
|
||||
pckry.options.columnWidth = '.grid-sizer';
|
||||
|
||||
for ( containerWidth = 290; containerWidth < 310; containerWidth++ ) {
|
||||
pckry.element.style.width = containerWidth + 'px';
|
||||
pckry.layout();
|
||||
assert.equal( 0, getItemsTotalY(), 'items fit with columnWidth at ' + containerWidth + 'px' );
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user