vpusher / the-grid

Grid layout custom element with drag and drop capabilities
https://www.webcomponents.org/element/vpusher/the-grid
MIT License
129 stars 32 forks source link

Added min/max Height/Width + updated Demo #14

Closed DarkSideOfMo0n closed 7 years ago

DarkSideOfMo0n commented 7 years ago

This will allow to put the attributes min-height, max-height, min-width and max-width on a child. If one of this attributes is set child can not grow smaller/bigger than its min max.

vpusher commented 7 years ago

@PascalLaier you need to declare the new properties as part of the component so you don't need to pass them in your _isWithinConstraints method.

DarkSideOfMo0n commented 7 years ago

Hi @vpusher, I´m not quite sure what you mean? Since these properties are the properties of player/child and can be different for every child. We may could write an behavior for the children of the grid which then has those properties.

vpusher commented 7 years ago

@PascalLaier I was thinking about 2 globals properties on the grid itself, so we can apply your behavior on all tiles by default. Then, if some tiles have their own mix/max attributes, they override the default. I will push this update on your branch asap.

What about ?

DarkSideOfMo0n commented 7 years ago

@vpusher Yes this sounds like a great idea. Will defnitly do that.