File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ export default class Thumbnail {
406406 return thumbDragUtils ;
407407 }
408408
409- getThumbHtml ( thumb : string , index : number ) : string {
409+ getThumbHtml ( thumb : string , index : number , alt ?: string ) : string {
410410 const slideVideoInfo =
411411 this . core . galleryItems [ index ] . __slideVideoInfo || { } ;
412412 let thumbImg ;
@@ -426,21 +426,23 @@ export default class Thumbnail {
426426 thumbImg = thumb ;
427427 }
428428
429+ const altAttr = alt ? 'alt="' + alt + '"' : '' ;
430+
429431 return `<div data-lg-item-id="${ index } " class="lg-thumb-item ${
430432 index === this . core . index ? ' active' : ''
431- } "
433+ } "
432434 style="width:${ this . settings . thumbWidth } px; height: ${
433435 this . settings . thumbHeight
434436 } ;
435437 margin-right: ${ this . settings . thumbMargin } px;">
436- <img data-lg-item-id="${ index } " src="${ thumbImg } " />
438+ <img ${ altAttr } data-lg-item-id="${ index } " src="${ thumbImg } " />
437439 </div>` ;
438440 }
439441
440442 getThumbItemHtml ( items : ThumbnailGalleryItem [ ] ) : string {
441443 let thumbList = '' ;
442444 for ( let i = 0 ; i < items . length ; i ++ ) {
443- thumbList += this . getThumbHtml ( items [ i ] . thumb , i ) ;
445+ thumbList += this . getThumbHtml ( items [ i ] . thumb , i , items [ i ] . alt ) ;
444446 }
445447
446448 return thumbList ;
You can’t perform that action at this time.
0 commit comments