File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4180
4180
type : 'type' , // type of dropdown element
4181
4181
image : 'image' , // optional image path
4182
4182
imageClass : 'imageClass' , // optional individual class for image
4183
+ alt : 'alt' , // optional alt text for image
4183
4184
icon : 'icon' , // optional icon name
4184
4185
iconClass : 'iconClass' , // optional individual class for icon (for example to use flag instead)
4185
4186
class : 'class' , // optional individual class for item/header
4357
4358
html += '<i class="' + ( itemType . indexOf ( 'left' ) !== - 1 ? 'left' : '' ) + ' dropdown icon"></i>' ;
4358
4359
}
4359
4360
if ( option [ fields . image ] ) {
4360
- html += '<img class="' + deQuote ( option [ fields . imageClass ] || className . image ) + '" src="' + deQuote ( option [ fields . image ] ) + '">' ;
4361
+ html += '<img class="' + deQuote ( option [ fields . imageClass ] || className . image ) + '" src="' + deQuote ( option [ fields . image ] ) + ( option [ fields . alt ] ? '" alt="' + deQuote ( option [ fields . alt ] ) : '' ) + '">' ;
4361
4362
}
4362
4363
if ( option [ fields . icon ] ) {
4363
4364
html += '<i class="' + deQuote ( option [ fields . icon ] + ' ' + ( option [ fields . iconClass ] || className . icon ) ) + '"></i>' ;
Original file line number Diff line number Diff line change 1444
1444
categoryResults : 'results' , // array of results (category view)
1445
1445
description : 'description' , // result description
1446
1446
image : 'image' , // result image
1447
+ alt : 'alt' , // result alt text for image
1447
1448
price : 'price' , // result price
1448
1449
results : 'results' , // array of results (standard)
1449
1450
title : 'title' , // result title
1531
1532
if ( result [ fields . image ] !== undefined ) {
1532
1533
html += ''
1533
1534
+ '<div class="image">'
1534
- + ' <img src="' + result [ fields . image ] . replace ( / " / g, '' ) + '">'
1535
+ + ' <img src="' + result [ fields . image ] . replace ( / " / g, '' ) + ( result [ fields . alt ] ? '" alt="' + result [ fields . alt ] . replace ( / " / g , '' ) : '' ) + '">'
1535
1536
+ '</div>' ;
1536
1537
}
1537
1538
html += '<div class="content">' ;
1584
1585
if ( result [ fields . image ] !== undefined ) {
1585
1586
html += ''
1586
1587
+ '<div class="image">'
1587
- + ' <img src="' + result [ fields . image ] . replace ( / " / g, '' ) + '">'
1588
+ + ' <img src="' + result [ fields . image ] . replace ( / " / g, '' ) + ( result [ fields . alt ] ? '" alt="' + result [ fields . alt ] . replace ( / " / g , '' ) : '' ) + '">'
1588
1589
+ '</div>' ;
1589
1590
}
1590
1591
html += '<div class="content">' ;
Original file line number Diff line number Diff line change 183
183
$toast . append ( $ ( '<img>' , {
184
184
class : className . image + ' ' + settings . classImage ,
185
185
src : settings . showImage ,
186
+ alt : settings . alt || '' ,
186
187
} ) ) ;
187
188
}
188
189
if ( settings . title !== '' ) {
228
229
$toast . find ( selector . icon ) . attr ( 'class' , iconClass + ' ' + className . icon ) ;
229
230
}
230
231
if ( settings . showImage ) {
231
- $toast . find ( selector . image ) . attr ( 'src' , settings . showImage ) ;
232
+ $toast . find ( selector . image ) . attr ( 'src' , settings . showImage ) . attr ( 'alt' , settings . alt || '' ) ;
232
233
}
233
234
if ( settings . title !== '' ) {
234
235
$toast . find ( selector . title ) . html ( module . helpers . escape ( settings . title , settings . preserveHTML ) ) ;
841
842
actions : false ,
842
843
preserveHTML : true ,
843
844
showImage : false ,
845
+ alt : false ,
844
846
845
847
// transition settings
846
848
transition : {
You can’t perform that action at this time.
0 commit comments