1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add fallback for Object.values call in IE11

This commit is contained in:
Nick O'Leary 2019-09-30 10:58:03 +01:00
parent 9775d3a33d
commit e5738d608c
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1296,8 +1296,13 @@ RED.nodes = (function() {
function filterNodes(filter) {
var result = [];
var searchSet = nodes;
if (filter.hasOwnProperty("z") && Object.hasOwnProperty("values") && nodeTabMap.hasOwnProperty(filter.z) ) {
searchSet = Object.values(nodeTabMap[filter.z]);
var doZFilter = false;
if (filter.hasOwnProperty("z")) {
if (Object.hasOwnProperty("values") && nodeTabMap.hasOwnProperty(filter.z) ) {
searchSet = Object.values(nodeTabMap[filter.z]);
} else {
doZFilter = true;
}
}
for (var n=0;n<searchSet.length;n++) {
@ -1305,6 +1310,9 @@ RED.nodes = (function() {
if (filter.hasOwnProperty("type") && node.type !== filter.type) {
continue;
}
if (doZFilter && node.z !== filter.z) {
continue;
}
result.push(node);
}
return result;