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 images and index variable available #15

Closed achorein closed 9 years ago

achorein commented 9 years ago

I need to add some actions on each image. For that I make a custom template wish call some new method injected by decorator :

    $provide.decorator('Lightbox', function($delegate) {
        $delegate.deleteImage = function(image) {
            alert("delImage : " + this.images + ", id" + image.id + ", index:", this.index);
            this.images.splice(this.index, 1);
            if (this.images.length == 0) this.closeModal()
        };
        return $delegate;
    });

to work, I need to have access to theses variables and make some changes :

    var Lightbox = {};

    // array of all images to be shown in the lightbox (not Image objects)
    Lightbox.images = [];

    // the index of the image currently shown (Lightbox.image)
    Lightbox.index = -1;

can you add this in next release ?

thanks

compact commented 9 years ago

Merged for v0.5.0, thanks.