mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-04 13:05:32 +00:00
Updated select2 to use tag_color if available
This commit is contained in:
25
public/js/dist/all.js
vendored
25
public/js/dist/all.js
vendored
@ -52590,36 +52590,35 @@ $(function () {
|
||||
return markup;
|
||||
}
|
||||
function formatDatalistSafe(datalist) {
|
||||
// console.warn("What in the hell is going on with Select2?!?!!?!?");
|
||||
// console.warn($.select2);
|
||||
if (datalist.loading) {
|
||||
return $('<i class="fas fa-spinner fa-spin" aria-hidden="true"></i> Loading...');
|
||||
}
|
||||
var root_div = $("<div class='clearfix'>");
|
||||
var left_pull = $("<div class='pull-left' style='padding-right: 10px;'>");
|
||||
if (datalist.image) {
|
||||
var inner_div = $("<div style='width: 30px;'>");
|
||||
var inner_div = $("<div style='width: 20px;'>");
|
||||
/******************************************************************
|
||||
*
|
||||
* We are specifically chosing empty alt-text below, because this
|
||||
*
|
||||
* We are specifically chosing empty alt-text below, because this
|
||||
* image conveys no additional information, relative to the text
|
||||
* that will *always* be there in any select2 list that is in use
|
||||
* in Snipe-IT. If that changes, we would probably want to change
|
||||
* some signatures of some functions, but right now, we don't want
|
||||
* screen readers to say "HP SuperJet 5000, .... picture of HP
|
||||
* screen readers to say "HP SuperJet 5000, .... picture of HP
|
||||
* SuperJet 5000..." and so on, for every single row in a list of
|
||||
* assets or models or whatever.
|
||||
*
|
||||
*
|
||||
*******************************************************************/
|
||||
var img = $("<img src='' style='max-height: 20px; max-width: 30px;' alt=''>");
|
||||
// console.warn("Img is: ");
|
||||
// console.dir(img);
|
||||
// console.warn("Strigularly, that's: ");
|
||||
// console.log(img);
|
||||
var img = $("<img src='' style='max-height: 20px; max-width: 20px;' alt=''>");
|
||||
img.attr("src", datalist.image);
|
||||
inner_div.append(img);
|
||||
} else if (datalist.tag_color) {
|
||||
var inner_div = $("<div style='width: 20px;'>");
|
||||
var icon = $('<i class="fa-solid fa-square" style="font-size: 20px;" aria-hidden="true"></i>');
|
||||
icon.css("color", datalist.tag_color);
|
||||
inner_div.append(icon);
|
||||
} else {
|
||||
var inner_div = $("<div style='height: 20px; width: 30px;'></div>");
|
||||
var inner_div = $("<div style='height: 20px; width: 20px;'></div>");
|
||||
}
|
||||
left_pull.append(inner_div);
|
||||
root_div.append(left_pull);
|
||||
|
||||
2
public/js/dist/all.js.map
vendored
2
public/js/dist/all.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
{
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=525664c0ec56444ba1c48c125346918a",
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=4a1a7267cc9c2fa8c71a80da3cf27898",
|
||||
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=68b775c727b842ea7206e45ef7dc6f7a",
|
||||
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=be05d91a777b604b23d1133117c55401",
|
||||
"/css/build/overrides.css": "/css/build/overrides.css?id=e453a0eae2a113de9a57d3bf8f5d5787",
|
||||
|
||||
Reference in New Issue
Block a user