lokesh / lightbox2

THE original Lightbox script (v2).
http://lokeshdhakar.com/projects/lightbox2/
MIT License
6.19k stars 1.76k forks source link

[Feature Request] Support for action toolbar #563

Closed sangupta closed 6 years ago

sangupta commented 7 years ago

Add support to load an action toolbar along the image. Say, binding a DOM element to the footer. This will allow us to use lightbox for letting a user run actions on images with a single handler interface.

For example, add the following to options:

lightbox.option({
  toolbar: '.lightbox.toolbar'
})

And there is a DIV somewhere in the body that produces a toolbar:

<div class=".lightbox.toolbar">
    <a href="#" class="button" data-handler="saveImage">Save</a>
    <a href="#" class="button" data-handler="tweetImage">Tweet</a>
</div>

where the handlers themselves can be added this way:

function saveImage(url, element) {
  // do something
}

function tweetImage(url, element) {
  // do something
}

Note: Am not a front-end guy, so there may be a better way to structure the code than above.

lokesh commented 6 years ago

Closing out old issues.

This feature unfortunately never made it on the roadmap.