Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow negative numbers to be passed to parseHeight function #370

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

Merged
merged 4 commits into from
Mar 1, 2016

Conversation

krema
Copy link
Contributor

@krema krema commented Feb 28, 2016

It should be possible to call for example the verticalMargin method with negative numbers.

verticalMargin('-5px')

Instead of bypassing the method

grid.opts.verticalMarginUnit = 'px';
grid.opts.verticalMargin = '-5';
grid._updateStyles();

@krema
Copy link
Contributor Author

krema commented Feb 28, 2016

Sorry about the failed checks. I will update the pull request tonight.

@radiolips
Copy link
Member

What's the scenario when you'd want a negative vertical margin?

@krema
Copy link
Contributor Author

krema commented Feb 29, 2016

Let's say you have set borders for each "grid-stack-item-content" to 10px and want to display each grid item seamlessly without displaying border twice then you need to decrease the space between the items for one border width. A verticalMargin('0') is not enough to display the items seamlessly.

verticalMargin('0'):

verticalmargin0

verticalMargin('-10px'):

verticalmargin_minus6

@troolee
Copy link
Member

troolee commented Feb 29, 2016

Please update unit tests for parseHeight function to add this case

troolee added a commit that referenced this pull request Mar 1, 2016
Allow negative numbers to be passed to parseHeight function
@troolee troolee merged commit 156b8e4 into gridstack:master Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants