gallery thumbnail shouldn't clone contracted image/video
This commit is contained in:
parent
a35f547cdd
commit
e69d6b2e7c
@ -7346,18 +7346,20 @@
|
||||
return nodes.total.textContent = --i;
|
||||
},
|
||||
generateThumb: function(file) {
|
||||
var double, post, thumb, title;
|
||||
var post, thumb, thumbImg, title;
|
||||
post = Get.postFromNode(file);
|
||||
title = ($('.fileText a', file)).textContent;
|
||||
thumb = post.file.thumb.parentNode.cloneNode(true);
|
||||
if (double = $('img + img', thumb)) {
|
||||
$.rm(double);
|
||||
}
|
||||
thumb.className = 'gal-thumb';
|
||||
thumb.title = title;
|
||||
thumb.dataset.id = Gallery.images.length;
|
||||
thumb.dataset.post = $('a[title="Highlight this post"]', post.nodes.info).href;
|
||||
thumb.firstElementChild.style.cssText = '';
|
||||
thumb = $.el('a', {
|
||||
className: 'gal-thumb',
|
||||
href: post.file.URL,
|
||||
target: '_blank'
|
||||
}, title = title, {
|
||||
'data-id': Gallery.images.length,
|
||||
'data-post': $('a[title="Highlight this post"]', post.nodes.info).href
|
||||
});
|
||||
thumbImg = post.file.thumb.cloneNode(false);
|
||||
thumbImg.style.cssText = '';
|
||||
$.add(thumb, thumbImg);
|
||||
$.on(thumb, 'click', Gallery.cb.open);
|
||||
Gallery.images.push(thumb);
|
||||
return $.add(Gallery.nodes.thumbs, thumb);
|
||||
|
||||
@ -7365,18 +7365,20 @@
|
||||
return nodes.total.textContent = --i;
|
||||
},
|
||||
generateThumb: function(file) {
|
||||
var double, post, thumb, title;
|
||||
var post, thumb, thumbImg, title;
|
||||
post = Get.postFromNode(file);
|
||||
title = ($('.fileText a', file)).textContent;
|
||||
thumb = post.file.thumb.parentNode.cloneNode(true);
|
||||
if (double = $('img + img', thumb)) {
|
||||
$.rm(double);
|
||||
}
|
||||
thumb.className = 'gal-thumb';
|
||||
thumb.title = title;
|
||||
thumb.dataset.id = Gallery.images.length;
|
||||
thumb.dataset.post = $('a[title="Highlight this post"]', post.nodes.info).href;
|
||||
thumb.firstElementChild.style.cssText = '';
|
||||
thumb = $.el('a', {
|
||||
className: 'gal-thumb',
|
||||
href: post.file.URL,
|
||||
target: '_blank'
|
||||
}, title = title, {
|
||||
'data-id': Gallery.images.length,
|
||||
'data-post': $('a[title="Highlight this post"]', post.nodes.info).href
|
||||
});
|
||||
thumbImg = post.file.thumb.cloneNode(false);
|
||||
thumbImg.style.cssText = '';
|
||||
$.add(thumb, thumbImg);
|
||||
$.on(thumb, 'click', Gallery.cb.open);
|
||||
Gallery.images.push(thumb);
|
||||
return $.add(Gallery.nodes.thumbs, thumb);
|
||||
|
||||
@ -106,16 +106,18 @@ Gallery =
|
||||
generateThumb: (file) ->
|
||||
post = Get.postFromNode file
|
||||
title = ($ '.fileText a', file).textContent
|
||||
thumb = post.file.thumb.parentNode.cloneNode true
|
||||
if double = $ 'img + img', thumb
|
||||
$.rm double
|
||||
|
||||
thumb.className = 'gal-thumb'
|
||||
thumb.title = title
|
||||
thumb.dataset.id = Gallery.images.length
|
||||
thumb.dataset.post = $('a[title="Highlight this post"]', post.nodes.info).href
|
||||
thumb.firstElementChild.style.cssText = ''
|
||||
thumb = $.el 'a',
|
||||
className: 'gal-thumb'
|
||||
href: post.file.URL
|
||||
target: '_blank'
|
||||
title = title
|
||||
'data-id': Gallery.images.length
|
||||
'data-post': $('a[title="Highlight this post"]', post.nodes.info).href
|
||||
|
||||
thumbImg = post.file.thumb.cloneNode false
|
||||
thumbImg.style.cssText = ''
|
||||
$.add thumb, thumbImg
|
||||
|
||||
$.on thumb, 'click', Gallery.cb.open
|
||||
|
||||
Gallery.images.push thumb
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user