From 8e0730aabe1dd728f531f63114ae556023a6616f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 2 Oct 2016 17:53:37 -0400 Subject: #201 - initial framework - still buggy Former-commit-id: 06b81da17f62a04219cba920d3997c3040e76d94 --- www/external/packery.pkgd.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'www/external/packery.pkgd.js') diff --git a/www/external/packery.pkgd.js b/www/external/packery.pkgd.js index a85a10f4..66c3b21f 100644 --- a/www/external/packery.pkgd.js +++ b/www/external/packery.pkgd.js @@ -2758,6 +2758,20 @@ Packery.prototype.getShiftPositions = function( attrName ) { }); }; +// get JSON-friendly data for items positions +Packery.prototype.EHgetShiftPositions = function( attrName ) { + attrName = attrName || 'id'; + var _this = this; + return this.items.map( function( item ) { + return { + attr: item.element.getAttribute( attrName ), + size: item.element.getAttribute ("eh-data-item-size"), + display: item.element.getAttribute ("eh-data-item-listdisplay"), + x: item.rect.x / _this.packer.width, + y: item.rect.y / _this.packer.height + } + }); +}; Packery.prototype.initShiftLayout = function( positions, attr ) { if ( !positions ) { // if no initial positions, run packery layout -- cgit v1.2.3