mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge branch 'develop' of https://github.com/sw-mreyes/snipe-it into sw-mreyes-develop
# Conflicts: # public/mix-manifest.json
This commit is contained in:
commit
4ddab03792
Binary file not shown.
BIN
public/js/dist/all.js
vendored
BIN
public/js/dist/all.js
vendored
Binary file not shown.
|
@ -159,6 +159,58 @@ $(function () {
|
|||
});
|
||||
});
|
||||
|
||||
function formatDatalistSafe(datalist) {
|
||||
// console.warn("What in the hell is going on with Select2?!?!!?!?");
|
||||
// console.warn($.select2);
|
||||
if (datalist.loading) {
|
||||
return $('<i class="fa 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;'>");
|
||||
/******************************************************************
|
||||
*
|
||||
* 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
|
||||
* 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);
|
||||
img.attr("src", datalist.image );
|
||||
inner_div.append(img)
|
||||
} else {
|
||||
var inner_div=$("<div style='height: 20px; width: 30px;'></div>");
|
||||
}
|
||||
left_pull.append(inner_div);
|
||||
root_div.append(left_pull);
|
||||
var name_div = $("<div>");
|
||||
name_div.text(datalist.text);
|
||||
root_div.append(name_div)
|
||||
var safe_html = root_div.get(0).outerHTML;
|
||||
var old_html = formatDatalist(datalist);
|
||||
if(safe_html != old_html) {
|
||||
console.log("HTML MISMATCH: ");
|
||||
console.log("FormatDatalistSafe: ");
|
||||
// console.dir(root_div.get(0));
|
||||
console.log(safe_html);
|
||||
console.log("FormatDataList: ");
|
||||
console.log(old_html);
|
||||
}
|
||||
return root_div;
|
||||
|
||||
}
|
||||
|
||||
function formatDatalist (datalist) {
|
||||
var loading_markup = '<i class="fa fa-spinner fa-spin" aria-hidden="true"></i> Loading...';
|
||||
if (datalist.loading) {
|
||||
|
|
Loading…
Reference in a new issue