Skip to content

Commit 657d167

Browse files
committed
Build with expand fixes
1 parent 776f96a commit 657d167

File tree

2 files changed

+39
-28
lines changed

2 files changed

+39
-28
lines changed

build/jsroot.js

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const version_id = '7.9.x',
1212

1313
/** @summary version date
1414
* @desc Release date in format day/month/year like '14/04/2022' */
15-
version_date = '24/09/2025',
15+
version_date = '13/10/2025',
1616

1717
/** @summary version id and date
1818
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -113928,7 +113928,7 @@ class TDrawSelector extends TSelector {
113928113928
if (args.dump) {
113929113929
this.dump_values = true;
113930113930
args.reallocate_objects = true;
113931-
if (args.numentries === undefined) {
113931+
if ((args.numentries === undefined) && !args.elist) {
113932113932
args.numentries = 10;
113933113933
args._dflt_entries = true;
113934113934
}
@@ -156271,14 +156271,20 @@ class HierarchyPainter extends BasePainter {
156271156271

156272156272
/** @summary Expand to specified level
156273156273
* @protected */
156274-
async exapndToLevel(level) {
156274+
async expandToLevel(level) {
156275156275
if (!level || !Number.isFinite(level) || (level < 0)) return this;
156276156276

156277156277
const promises = [];
156278156278
this.toggleOpenState(true, this.h, promises);
156279-
return Promise.all(promises).then(() => this.exapndToLevel(level - 1));
156279+
return Promise.all(promises).then(() => this.expandToLevel(level - 1));
156280156280
}
156281156281

156282+
/** @summary Expand to specified level
156283+
* @deprecated will be removed in version 8, kept only for backward compatibility
156284+
* @protected */
156285+
async exapndToLevel(level) { return this.expandToLevel(level); }
156286+
156287+
156282156288
/** @summary Refresh HTML code of hierarchy painter
156283156289
* @return {Promise} when done */
156284156290
async refreshHtml() {
@@ -156517,7 +156523,8 @@ class HierarchyPainter extends BasePainter {
156517156523
}
156518156524

156519156525
// special feature - all items with '_expand' function are not drawn by click
156520-
if ((place === 'item') && ('_expand' in hitem) && !evnt.ctrlKey && !evnt.shiftKey) place = kPM;
156526+
if ((place === 'item') && ('_expand' in hitem) && !hitem._expand_miss && !evnt.ctrlKey && !evnt.shiftKey)
156527+
place = kPM;
156521156528

156522156529
// special case - one should expand item
156523156530
if (((place === kPM) && !('_childs' in hitem) && hitem._more) ||
@@ -156843,7 +156850,7 @@ class HierarchyPainter extends BasePainter {
156843156850

156844156851
if ((sett.expand || sett.get_expand) && (hitem._more || hitem._more === undefined)) {
156845156852
if (hitem._childs === undefined)
156846-
menu.add('Expand', () => this.expandItem(itemname), 'Exapnd content of object');
156853+
menu.add('Expand', () => this.expandItem(itemname), 'Expand content of object');
156847156854
else {
156848156855
menu.add('Unexpand', () => {
156849156856
hitem._more = true;
@@ -157517,7 +157524,24 @@ class HierarchyPainter extends BasePainter {
157517157524
if (!hitem && d3cont)
157518157525
return;
157519157526

157527+
function doneExpandItem(_item) {
157528+
if (_item._childs === undefined)
157529+
_item._expand_miss = true;
157530+
else {
157531+
_item._isopen = true;
157532+
if (_item._parent && !_item._parent._isopen) {
157533+
_item._parent._isopen = true; // also show parent
157534+
if (!silent)
157535+
hpainter.updateTreeNode(_item._parent);
157536+
} else if (!silent)
157537+
hpainter.updateTreeNode(_item, d3cont);
157538+
}
157539+
return _item;
157540+
}
157541+
157520157542
async function doExpandItem(_item, _obj) {
157543+
delete _item._expand_miss;
157544+
157521157545
if (isStr(_item._expand))
157522157546
_item._expand = findFunction(_item._expand);
157523157547

@@ -157548,28 +157572,15 @@ class HierarchyPainter extends BasePainter {
157548157572

157549157573
// try to use expand function
157550157574
if (_obj && isFunc(_item._expand)) {
157551-
if (_item._expand(_item, _obj)) {
157552-
_item._isopen = true;
157553-
if (_item._parent && !_item._parent._isopen) {
157554-
_item._parent._isopen = true; // also show parent
157555-
if (!silent)
157556-
hpainter.updateTreeNode(_item._parent);
157557-
} else if (!silent)
157558-
hpainter.updateTreeNode(_item, d3cont);
157559-
return _item;
157560-
}
157575+
if (_item._expand(_item, _obj))
157576+
return doneExpandItem(_item);
157561157577
}
157562157578

157563-
if (_obj && objectHierarchy(_item, _obj)) {
157564-
_item._isopen = true;
157565-
if (_item._parent && !_item._parent._isopen) {
157566-
_item._parent._isopen = true; // also show parent
157567-
if (!silent) hpainter.updateTreeNode(_item._parent);
157568-
} else if (!silent)
157569-
hpainter.updateTreeNode(_item, d3cont);
157570-
return _item;
157571-
}
157579+
if (_obj && objectHierarchy(_item, _obj))
157580+
return doneExpandItem(_item);
157572157581

157582+
// mark as expand miss - behaves as normal object
157583+
_item._expand_miss = true;
157573157584
return -1;
157574157585
}
157575157586

@@ -157760,7 +157771,7 @@ class HierarchyPainter extends BasePainter {
157760157771
_expand: item => {
157761157772
return openFile(item._url).then(file => {
157762157773
if (!file) return false;
157763-
delete item._exapnd;
157774+
delete item._expand;
157764157775
delete item._more;
157765157776
delete item._click_action;
157766157777
delete item._obj;
@@ -158934,7 +158945,7 @@ async function drawInspector(dom, obj, opt) {
158934158945

158935158946
return painter.refreshHtml().then(() => {
158936158947
painter.setTopPainter();
158937-
return painter.exapndToLevel(expand_level);
158948+
return painter.expandToLevel(expand_level);
158938158949
});
158939158950
}
158940158951

modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const version_id = '7.9.x',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '24/09/2025',
7+
version_date = '13/10/2025',
88

99
/** @summary version id and date
1010
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

0 commit comments

Comments
 (0)