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

Trim the left & right margins #4

Open
coryking opened this issue Oct 20, 2014 · 4 comments
Open

Trim the left & right margins #4

coryking opened this issue Oct 20, 2014 · 4 comments

Comments

@coryking
Copy link

I'm trying to fit this lightbox into a mobile screen. There is a huge amount of margins on the left & right of every image.

I'm not sure how to go about customizing this. I see the "calculateImageDimensionLimits" & "calculateModalDimensions" but don't know how to change any of those values. Should those hard-coded numbers be baked into the configuration?

@compact
Copy link
Owner

compact commented Oct 25, 2014

Please try with v0.3.1.

If the problem remains, what devices/browsers are you using? Do the images not fill up the screen vertically when there are side margins?

The hard-coded numbers are not good practice, though they are directly based on Bootstrap's CSS values. I'll think about whether there's a better way to do it.

@Ryuno-Ki
Copy link

@compact You could, at the very least, put those numbers into an object and expose it to the developers to make it more configurable.

@compact
Copy link
Owner

compact commented Oct 24, 2015

You can edit the calculation methods themselves, as in http://compact.github.io/angular-bootstrap-lightbox/demo2/index.html

@wintermute42
Copy link

In my experience, setting dimensions to max actually works pretty well:

    LightboxProvider.calculateImageDimensionLimits = function (dimensions) {
        return {
            'maxWidth': dimensions.windowWidth,
            'maxHeight': dimensions.windowHeight
        };
    };

    LightboxProvider.calculateModalDimensions = function (dimensions) {
        return {
            'width': dimensions.imageDisplayWidth,
            'height': dimensions.imageDisplayHeight
        };
    };

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

4 participants