diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-02 17:53:37 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-02 17:53:37 -0400 |
| commit | 8e0730aabe1dd728f531f63114ae556023a6616f (patch) | |
| tree | 870df766576a104912ce7270b9277ef84e3fc4f0 /www/external | |
| parent | 40ede2996c386fb4f58b2ede19ff5503ece628eb (diff) | |
#201 - initial framework - still buggy
Former-commit-id: 06b81da17f62a04219cba920d3997c3040e76d94
Diffstat (limited to 'www/external')
| -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 |
