compact / angular-bootstrap-lightbox

An AngularJS lightbox built using UI Bootstrap Modal.
http://compact.github.io/angular-bootstrap-lightbox/
MIT License
306 stars 134 forks source link

Make window same size as image (full size) #77

Open tejaskhot opened 7 years ago

tejaskhot commented 7 years ago

I am currently using this as per the comments in other open issues:

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

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

I have also tried variants of these and they don't seem to work. I want the modal to be of same size as the image, be it a small image or a large one - no white border around.

How can this be achieved?

elementdigital commented 7 years ago

I reworked the core, but you could also use the same methods in provider.config https://github.com/elementdigital/angular-bootstrap-lightbox/tree/style-animate