Skip to content

Commit e137b3b

Browse files
committed
updated simple-lightbox
1 parent 2839646 commit e137b3b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

simple-lightbox/get.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
VERSION="v2.14.1"
3+
VERSION="v2.14.2"
44

55
wget https://raw.githubusercontent.com/andreknieriem/simplelightbox/$VERSION/dist/simple-lightbox.js -O simple-lightbox.js
66
wget https://raw.githubusercontent.com/andreknieriem/simplelightbox/$VERSION/dist/simple-lightbox.css -O simple-lightbox.less

simple-lightbox/simple-lightbox.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
By André Rinas, www.andrerinas.de
33
Documentation, www.simplelightbox.com
44
Available for use under the MIT License
5-
Version 2.14.1
5+
Version 2.14.2
66
*/
77
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
88
(function (global){(function (){
@@ -42,6 +42,7 @@ var SimpleLightbox = /*#__PURE__*/function () {
4242
captionsData: 'title',
4343
captionPosition: 'bottom',
4444
captionClass: '',
45+
captionHTML: true,
4546
close: true,
4647
closeText: '&times;',
4748
swipeClose: true,
@@ -259,7 +260,7 @@ var SimpleLightbox = /*#__PURE__*/function () {
259260
if (this.options.captionSelector.startsWith('+')) {
260261
var selector = this.options.captionSelector.replace(/^\+/, '').trimStart();
261262
var sibling = elem.nextElementSibling;
262-
if (sibling.matches(selector)) {
263+
if (sibling && sibling.matches(selector)) {
263264
return sibling;
264265
}
265266
return false;
@@ -1095,12 +1096,14 @@ var SimpleLightbox = /*#__PURE__*/function () {
10951096
}
10961097
}, {
10971098
key: "setCaption",
1098-
value: function setCaption(captionText, imageWidth) {
1099+
value: function setCaption(captionText, imageWidth, allowHTML) {
10991100
var _this7 = this;
11001101
if (this.options.captions && captionText && captionText !== '' && typeof captionText !== "undefined") {
1102+
var _ref;
1103+
var property = ((_ref = allowHTML !== null && allowHTML !== void 0 ? allowHTML : this.options.captionHTML) !== null && _ref !== void 0 ? _ref : true) ? 'innerHTML' : 'innerText';
11011104
this.hide(this.domNodes.caption);
11021105
this.domNodes.caption.style.width = imageWidth + 'px';
1103-
this.domNodes.caption.innerHTML = captionText;
1106+
this.domNodes.caption[property] = captionText;
11041107
this.domNodes.image.appendChild(this.domNodes.caption);
11051108
setTimeout(function () {
11061109
_this7.fadeIn(_this7.domNodes.caption, _this7.options.fadeSpeed);

simple-lightbox/simple-lightbox.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
By André Rinas, www.andrerinas.de
33
Documentation, www.simplelightbox.com
44
Available for use under the MIT License
5-
Version 2.14.1
5+
Version 2.14.2
66
*/
77
body.hidden-scroll {
88
overflow: hidden;

0 commit comments

Comments
 (0)