Update BDFDB.max.js
This commit is contained in:
parent
14f984b598
commit
a0bd0bce82
|
@ -3218,11 +3218,16 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
|
|
||||||
BDFDB.getContextMenuGroupAndIndex = function (startchildren, names) {
|
BDFDB.getContextMenuGroupAndIndex = function (startchildren, names) {
|
||||||
names = Array.isArray(names) ? names : (typeof names == "string" ? [names] : Array.from(names));
|
names = Array.isArray(names) ? names : (typeof names == "string" ? [names] : Array.from(names));
|
||||||
|
var startIsArray = Array.isArray(startchildren);
|
||||||
return search(startchildren);
|
return search(startchildren);
|
||||||
function search (children) {
|
function search (children) {
|
||||||
if (children && children.props && children.props.children) children = children.props.children;
|
if (children && children.props && children.props.children) children = children.props.children;
|
||||||
if (!Array.isArray(children)) return [startchildren, -1];
|
if (!Array.isArray(children)) return [startchildren, -1];
|
||||||
else {
|
else {
|
||||||
|
if (!startIsArray) {
|
||||||
|
startchildren = children;
|
||||||
|
startIsArray = true;
|
||||||
|
}
|
||||||
var result = [startchildren, -1];
|
var result = [startchildren, -1];
|
||||||
for (let i in children) if (children[i]) {
|
for (let i in children) if (children[i]) {
|
||||||
var displayname = children[i].type ? children[i].type.displayName || children[i].type.name || "" : "";
|
var displayname = children[i].type ? children[i].type.displayName || children[i].type.name || "" : "";
|
||||||
|
|
Loading…
Reference in New Issue