Skip to content
This repository has been archived by the owner on Aug 2, 2018. It is now read-only.

Commit

Permalink
Add gutter attribute - #19
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec committed Sep 24, 2014
1 parent 237511b commit 7bf23d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ It gives you:
Attribute | Options | Default | Description
--- | --- | --- | ---
`defaultTileSetup` | *Object* | see below | Overwrites default values for Tiles (`setup.items[?].?`)
`gutter` | *Number* | `0` | Overwrites default value of `setup.gutter`
`setup` | *Object* | | Tiles setup
`setup.gutter` | *Number* | `0` | Gutter/cell-spacing size in px
`setup.direction` | *String* | `rightDown` | How to align our package (horizontal layers `rightDown`, or vertiaval layers: `downRight`)
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<h1>&lt;juicy-tile-list&gt;</h1>
<blockquote><p>Masonry-like Polymer Element for sortable tiles that packs efficiently without changing HTML structure (changes CSS only).</p></blockquote>
<template bind>
<juicy-tile-list setup="{{setup}}">
<juicy-tile-list setup="{{setup}}" gutter="10">
<div>0</div>
<div>
<button>1</button>
Expand Down
6 changes: 4 additions & 2 deletions src/juicy-tile-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="package.js"></script>

<!-- Define your custom element -->
<polymer-element name="juicy-tile-list" constructor="JuicyTileListElement" attributes="setup rowspans colspans layersOrientation defaultTileSetup">
<polymer-element name="juicy-tile-list" constructor="JuicyTileListElement" attributes="setup layersOrientation defaultTileSetup gutter">
<template>
<style>
:host {
Expand Down Expand Up @@ -182,6 +182,9 @@
var that = this;

Package.call(this, this.setup);
if(this.gutter != undefined){
this.setup.gutter = parseInt(this.gutter, 10);
}

this.createItemsList();

Expand Down Expand Up @@ -319,7 +322,6 @@
* Refresh everything
*/
refresh: function( ) {
console.info(this,"refresh");
var container = this.$.container;
var packedTree = this.packItems();

Expand Down

0 comments on commit 7bf23d3

Please sign in to comment.