diff options
Diffstat (limited to 'www/external/packery.pkgd.js')
| -rw-r--r-- | www/external/packery.pkgd.js | 14 |
1 files changed, 14 insertions, 0 deletions
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 |
