summaryrefslogtreecommitdiff
path: root/www/external/packery.pkgd.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@users.noreply.github.com>2016-10-03 14:14:55 -0400
committerGitHub <noreply@github.com>2016-10-03 14:14:55 -0400
commite69b00e63f06bcccafc713a46fc31847d598d419 (patch)
tree94582a32a960488c2b3b0bc26577bc1c44e0d91a /www/external/packery.pkgd.js
parenta1a8d2e24f638ffe5bcf7229fcc84271aa145282 (diff)
parent8a8b1d9766735becc351643697ea9f495767ab6a (diff)
Merge pull request #340 from pliablepixels/shrinking-header
initial experiments Former-commit-id: 5194ee61e6690f8ddbdbba3e9dd14a116c9bd929
Diffstat (limited to 'www/external/packery.pkgd.js')
-rw-r--r--www/external/packery.pkgd.js14
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