Kris-B / nanoGALLERY

image gallery simplified - jQuery plugin. Touch enabled, responsive, justified/cascading/grid layout and it supports pulling in Flickr, Google Photos and self hosted images.
https://nanogallery2.nanostudio.org/
439 stars 101 forks source link

Items selection #65

Closed R-II closed 9 years ago

R-II commented 9 years ago

Hi Kris,

I have added a support for selection. I have added a few properties and methods to make external apps able to handle a selection made in nanoGallery.

I still have to work on ergonomy problems, especially on touch devices, and making more obvious the ability to select.

New methods

Initialization :

$("#yourElement").nanoGallery({...});

Set an option :

$("#yourElement").nanoGallery("option",option_name,new_value);

Get an option :

$("#yourElement").nanoGallery("option",option_name);

Get an item :

$("#yourElement").nanoGallery("getItem",item_index);

Get every items :

$("#yourElement").nanoGallery("getItems");

Get the indexes of some items :

$("#yourElement").nanoGallery("getItemsIndex",[item1, item2, item3, ...]);

Select some items :

$("#yourElement").nanoGallery("selectItems",[item1, item2, item3, ...]);

Unselect some items :

$("#yourElement").nanoGallery("unselectItems",[item1, item2, item3, ...]);

List selected items :

$("#yourElement").nanoGallery("getSelectedItems");

New properties

itemsSelectable (bool) : define if the gallery supports selection

fnThumbnailSelection (function) : called any time an item is selected or unselected

Do not hesitate to tell me if you find anything wrong.

Raph

Kris-B commented 9 years ago

Hi Raph,

Very nice feature. Many thanks!

Kris-B commented 9 years ago

Hi Raph, I'm working on some code redesign. Before pushing any new contribution, please use the latest source version. Thanks!