Open mdconaway opened 8 years ago
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 ?
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
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.
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
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