mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #5017 from node-red/5004-icon-fix-2
Fix library icon handling within library browser component
This commit is contained in:
commit
b355a37378
@ -245,10 +245,15 @@ RED.library = (function() {
|
|||||||
if (lib.types && lib.types.indexOf(options.url) === -1) {
|
if (lib.types && lib.types.indexOf(options.url) === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let icon = 'fa fa-hdd-o';
|
||||||
|
if (lib.icon) {
|
||||||
|
const fullIcon = RED.utils.separateIconPath(lib.icon);
|
||||||
|
icon = (fullIcon.module==="font-awesome"?"fa ":"")+fullIcon.file;
|
||||||
|
}
|
||||||
listing.push({
|
listing.push({
|
||||||
library: lib.id,
|
library: lib.id,
|
||||||
type: options.url,
|
type: options.url,
|
||||||
icon: lib.icon || 'fa fa-hdd-o',
|
icon,
|
||||||
label: RED._(lib.label||lib.id),
|
label: RED._(lib.label||lib.id),
|
||||||
path: "",
|
path: "",
|
||||||
expanded: true,
|
expanded: true,
|
||||||
@ -303,10 +308,15 @@ RED.library = (function() {
|
|||||||
if (lib.types && lib.types.indexOf(options.url) === -1) {
|
if (lib.types && lib.types.indexOf(options.url) === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let icon = 'fa fa-hdd-o';
|
||||||
|
if (lib.icon) {
|
||||||
|
const fullIcon = RED.utils.separateIconPath(lib.icon);
|
||||||
|
icon = (fullIcon.module==="font-awesome"?"fa ":"")+fullIcon.file;
|
||||||
|
}
|
||||||
listing.push({
|
listing.push({
|
||||||
library: lib.id,
|
library: lib.id,
|
||||||
type: options.url,
|
type: options.url,
|
||||||
icon: lib.icon || 'fa fa-hdd-o',
|
icon,
|
||||||
label: RED._(lib.label||lib.id),
|
label: RED._(lib.label||lib.id),
|
||||||
path: "",
|
path: "",
|
||||||
expanded: true,
|
expanded: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user