Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Fastbyte01/KeepIt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Pignataro <rogepix@gmail.com>2019-09-13 00:17:36 +0300
committerGiuseppe Pignataro <rogepix@gmail.com>2019-09-13 00:17:36 +0300
commita0382b486758f7ae399cd0c7cb681ccec1248a03 (patch)
tree93004a9badd93fbc94c281e5420292def42db7ba
parent58cba1f8e96721c039f07fc585cefd520e36afb2 (diff)
Minor changes
-rw-r--r--assets/js/lightGallery-init.js102
1 files changed, 51 insertions, 51 deletions
diff --git a/assets/js/lightGallery-init.js b/assets/js/lightGallery-init.js
index 67de405..fc629ba 100644
--- a/assets/js/lightGallery-init.js
+++ b/assets/js/lightGallery-init.js
@@ -1,54 +1,54 @@
- $(document).ready(function() {
- let items = [];
- $('.post-content figure').each(function() {
- if ($(this).attr('class') == 'gallery-ignore') return true; // ignore any figures where class="pswp-ignore"
- // get properties from child a/img/figcaption elements,
- let $figure = $(this),
- $img = $figure.find('img'),
- $src = $img.attr('data-src'),
- $title = $figure.find('figcaption').html();
+$(document).ready(function () {
+ let items = [];
+ $('.post-content figure').each(function () {
+ if ($(this).attr('class') == 'gallery-ignore') return true; // ignore any figures where class="pswp-ignore"
+ // get properties from child a/img/figcaption elements,
+ let $figure = $(this),
+ $img = $figure.find('img'),
+ $src = $img.attr('data-src'),
+ $title = $figure.find('figcaption').html();
- if ($img.data('size')) {
- let $size = $a.data('size').split('x');
- var item = {
- 'src': $src,
- 'thumb': $src,
- 'subHtml': $title,
- 'width': $size[0],
- 'height': $size[1]
- }
- }else{
- var item = {
- 'src': $src,
- 'thumb': $src,
- 'subHtml': $title
- }
- var img = new Image();
- img.src = $src;
- var wait = setInterval(function() {
- var w = img.naturalWidth,
- h = img.naturalHeight;
- if (w && h) {
- clearInterval(wait);
- item.width = w;
- item.height = h;
- }
- }, 30);
- }
-
- var index = items.length;
- items.push(item);
+ if ($img.data('size')) {
+ let $size = $a.data('size').split('x');
+ var item = {
+ 'src': $src,
+ 'thumb': $src,
+ 'subHtml': $title,
+ 'width': $size[0],
+ 'height': $size[1]
+ }
+ } else {
+ var item = {
+ 'src': $src,
+ 'thumb': $src,
+ 'subHtml': $title
+ }
+ var img = new Image();
+ img.src = $src;
+ var wait = setInterval(function () {
+ var w = img.naturalWidth,
+ h = img.naturalHeight;
+ if (w && h) {
+ clearInterval(wait);
+ item.width = w;
+ item.height = h;
+ }
+ }, 30);
+ }
+
+ var index = items.length;
+ items.push(item);
// console.log(item)
- $figure.on('click', function(event) {
- event.preventDefault();
- $(this).lightGallery({
- dynamic: true,
- download: false,
- showThumbByDefault: false,
- dynamicEl: items,
- index: index
- })
- });
- });
- }); \ No newline at end of file
+ $figure.on('click', function (event) {
+ event.preventDefault();
+ $(this).lightGallery({
+ dynamic: true,
+ download: false,
+ showThumbByDefault: false,
+ dynamicEl: items,
+ index: index
+ })
+ });
+ });
+}); \ No newline at end of file