Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GutterWidth and GutterHeight options #384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrGrabazu
Copy link

I add the support of gutterWidth and gutterHeight options.
If gutter option is provided so it will be dispatched to gutterWidth and gutterHeight.
If a class name is provided, I set the width css property value to gutterWidth option and height css property value to gutterHeight option.
Tell me what do you think about it.

…ated and is set to both gutterWidth and gutterHeight is present in options. Add a sandbox file.
@MrGrabazu MrGrabazu closed this Jun 9, 2016
@MrGrabazu MrGrabazu reopened this Jun 9, 2016
@desandro
Copy link
Member

Thanks so much for this contribution! This is tremendous work. But I'm a bit particular about the implementation. Having gutter, gutterWidth and gutterHeight may be confusing. I think being able to set gutterWidth and gutterHeight via an array would be more flexible

// single value for both gutterWidth and gutterHeight
gutter: 20
// use width of element for width and height (to maintain backwards compatibility)
gutter: '.gutter-sizer'
// separate values for width and height, set as array
gutter: [ 20, 10 ]
// element width for width, element height for height
gutter: [ '.gutter-sizer', '.gutter-sizer' ]

I appreciate all the word you did here. This issue has gained enough interest that this PR would make a great addition.

@MrGrabazu
Copy link
Author

Yeah an array is a better idea :) and more flexible indeed !
I will use it in my fork, and add it to this pull request. Thank you for your support !

@@ -63,7 +63,11 @@ var proto = Packery.prototype;
proto._create = function() {
// call super
Outlayer.prototype._create.call( this );

//handle gutter
if(this.gutter) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not available here, need to use this.options.gutter

@mkhazov
Copy link

mkhazov commented Aug 9, 2016

@MrGrabazu thanks!
I made some changes in #396 so gutter option now can be an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants