Added alt text to image formatter in bootstrap tables

This commit is contained in:
snipe 2020-03-27 22:01:24 -07:00
parent 9a2ee2638b
commit a8f6bbd86a

View file

@ -250,7 +250,7 @@
item_icon = 'fa-map-marker'; item_icon = 'fa-map-marker';
} }
return '<nobr><a href="{{ url('/') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="fa ' + item_icon + ' text-blue"></i> ' + value.name + '</a></nobr>'; return '<nobr><a href="{{ url('/') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="fa ' + item_icon + ' text-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} "></i> ' + value.name + '</a></nobr>';
} else { } else {
return ''; return '';
@ -527,9 +527,19 @@
} }
function imageFormatter(value) { function imageFormatter(value, row) {
if (value) { if (value) {
return '<a href="' + value + '" data-toggle="lightbox" data-type="image"><img src="' + value + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>';
if (row.name) {
var altName = row.name;
}
else if ((row) && (row.model)) {
var altName = row.model.name;
}
return '<a href="' + value + '" data-toggle="lightbox" data-type="image"><img src="' + value + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="' + altName + '"></a>';
} }
} }