mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
js function to ingest icons
This commit is contained in:
parent
ef6d40bb68
commit
0b8a88e216
@ -130,6 +130,11 @@ function inventreeDocReady() {
|
|||||||
minLength: 2,
|
minLength: 2,
|
||||||
classes: {'ui-autocomplete': 'dropdown-menu search-menu'},
|
classes: {'ui-autocomplete': 'dropdown-menu search-menu'},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Generate brand-icons
|
||||||
|
$('.brand-icon').each(function(i, obj){
|
||||||
|
loadBrandIcon($(this), $(this).attr('brand_name'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFileTransfer(transfer) {
|
function isFileTransfer(transfer) {
|
||||||
@ -381,4 +386,14 @@ function inventreeDel(name) {
|
|||||||
var key = 'inventree-' + name;
|
var key = 'inventree-' + name;
|
||||||
|
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadBrandIcon(elem, name) {
|
||||||
|
// check if icon exists
|
||||||
|
var icon = window.FontAwesome.icon({prefix: 'fab', iconName: name});
|
||||||
|
|
||||||
|
if (icon){
|
||||||
|
// add icon to button
|
||||||
|
elem.addClass('fab fa-' + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user