blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.75k stars 984 forks source link

Use getItemProperty when setting title #222

Closed acortelyou closed 7 years ago

acortelyou commented 7 years ago

Allows titles to be specified using data attributes.

blueimp commented 7 years ago

Thanks for your contribution, @acortelyou Unfortunately, I cannot accept your pull request in this form, as the getItemProperty method should also accept that a property has been set to the empty string. With your change, that would not be possible anymore and could result in unwanted side effects.

acortelyou commented 7 years ago

For properties defined on the HTMLElement prototype as a DOMString (e.g. the title or id properties), undefined is not a possible value. Elements that do not have a value explicitly set for these properties by the markup will return empty string as the value rather than undefined, because the property is defined as a String in the DOM type system. I will submit another pull request which addresses this issue so that dataset attributes can be used to specify all object properties.

blueimp commented 7 years ago

Thanks @acortelyou , for reference, the new (and merged) pull request is https://github.com/blueimp/Gallery/pull/223