Open h0lg opened 7 years ago
Hi. It should work ok. Could you please make some test case where it works not on and if will be some bug ill fix it. Please write to: valiano.ticksy.com its more complicated in the code because i use tge gallery html output in variaty of ways in cms versions.
On Friday, November 4, 2016, Holger Schmidt notifications@github.com wrote:
The documentation says about the treatment of the img tag attributes: http://unitegallery.net/index.php?page=documentation#installing_the_gallery
src - url of the thumbnail image data-image - url of the big image.
Trying that, however, the thumbnail is ignored. That means calling of var objItem = api.getItem(); both objItem.urlThumb and objItem.urlImage hold the URL of the big image i put in the data-image attribute.
I think I identified the part of the source responsible for it. Here are the lines I mean (19761 to 19777):
//get the big image var imageSrc = objChild.data("image"); if(!imageSrc || typeof imageSrc == "undefined") imageSrc = objChild.attr("src"); var dataThumb = objChild.data("thumb"); //if exists data-thumb, then the big image is src if(typeof dataThumb != "undefined" && dataThumb != ""){ objItem.urlThumb = dataThumb; objItem.urlImage = imageSrc; //objChild.attr("src", dataThumb); }else{ //if not, the thumb is src objItem.urlThumb = imageSrc; objItem.urlImage = objChild.data("image"); }
The issue is in the line objItem.urlThumb = imageSrc; because imageSrc has been initialized with var imageSrc = objChild.data("image");. Now I'm not sure whether I fully understand this code. It seems to me to try to
- set objItem.urlThumb preferred from data-thumb, otherwise from src
- set objItem.urlImage preferred from data-image, otherwise from src
If I understand correctly, I suggest the following code instead to fix the issue:
var src = objChild.attr("src");objItem.urlThumb = objChild.data("thumb") || src;objItem.urlImage = objChild.data("image") || src;
Thanks and keep up the good work!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vvvmax/unitegallery/issues/118, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_K_uTePRNvt0SNF0P3tJTyk69XglOXks5q62_rgaJpZM4Kp0KK .
The documentation says about the treatment of the img tag attributes:
Trying that, however, the thumbnail is ignored. That means calling of
var objItem = api.getItem();
bothobjItem.urlThumb
andobjItem.urlImage
hold the URL of the big image i put in thedata-image
attribute.I think I identified the part of the source responsible for it. Here are the lines I mean (19761 to 19777):
The issue is in the line
objItem.urlThumb = imageSrc;
becauseimageSrc
has been initialized withvar imageSrc = objChild.data("image");
. Now I'm not sure whether I fully understand this code. It seems to me to try toobjItem.urlThumb
preferred fromdata-thumb
, otherwise fromsrc
objItem.urlImage
preferred fromdata-image
, otherwise fromsrc
If I understand correctly, I suggest the following code instead to fix the issue:
Thanks and keep up the good work!