From a8f6bbd86ad4c3ebcebed5c077599581886bf3da Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 27 Mar 2020 22:01:24 -0700 Subject: [PATCH] Added alt text to image formatter in bootstrap tables --- .../views/partials/bootstrap-table.blade.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 3cfdb73f2..0c70e2c3c 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -250,7 +250,7 @@ item_icon = 'fa-map-marker'; } - return ' ' + value.name + ''; + return ' ' + value.name + ''; } else { return ''; @@ -527,9 +527,19 @@ } - function imageFormatter(value) { + function imageFormatter(value, row) { + + + if (value) { - return ''; + + if (row.name) { + var altName = row.name; + } + else if ((row) && (row.model)) { + var altName = row.model.name; + } + return '' + altName + ''; } }