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

feature:Maintain Widget Aspect Ratio #530

Open
mdconaway opened this issue Jul 31, 2015 · 4 comments
Open

feature:Maintain Widget Aspect Ratio #530

mdconaway opened this issue Jul 31, 2015 · 4 comments

Comments

@mdconaway
Copy link

For the purpose of my project here:
https://github.com/mdconaway/vchat

I needed a dynamic option to force all gridster widgets to maintain their initial aspect ratios while also being resizeable.

I have added this feature into the code base, and by default it does not alter any behavior within gridster. To enable forced aspect ratios, a user can now simply pass in the parameter: 'maintain_aspect_ratio:boolean' as a part of the 'options' object that is sent to a gridster constructor. The aspect ratio logic uses a greatest change differential comparison to adjust the overall widget dimensions based on whether a user has made larger overall adjustments vertically or laterally.

I will create a pull request to close this feature request

mdconaway pushed a commit to mdconaway/gridster.js that referenced this issue Jul 31, 2015
change gridster constructor to accept a new parameter 'maintain_aspect_ratio:boolean' that defaults to false and modify method 'on_resize' to force aspect ratio if feature is enabled

Closes ducksboard#530
@jeevakannan-u
Copy link

jeevakannan-u commented Aug 23, 2016

I want to have the same feature of maintaining the Aspect ratio ? How could I do that? Has this feature got merged into the original code base ?

@mdconaway
Copy link
Author

Hey jeevakannan-u! I don't think the original maintainer of the project is keeping it up to date, but you can pull my branch with the fix here:
https://github.com/mdconaway/gridster.js/tree/aspectRatio

@mdconaway
Copy link
Author

Just a note on the link above:
I have another branch of gridster (https://github.com/mdconaway/gridster.js/tree/destructorBug) where I also fixed a bug in their instance destructor. This prevents memory leaks. You should pull both branches and merge them into one mainline to have a fully corrected version of gridster. If I still used this library I would try to become a primary maintainer, but I have moved on to other things as of late.

@mdconaway
Copy link
Author

Or, if you just want the distributable version of the library (with both fixes), you can just grab this single file here:

https://github.com/mdconaway/vchat/blob/master/vchat/vendor/lib/gridster.js

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

No branches or pull requests

2 participants