Skip to content

Commit c03e47c

Browse files
committed
Fix functionality "open all" / "close all" GUI buttons
1 parent d4bbde0 commit c03e47c

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
1. Fix zooming in color palette
55
2. Fix interactive update of TGraph painting on time scale
66
3. Fix I/O error in reading std::map (#204)
7+
4. Fix functionality "open all" / "close all" GUI buttons
78

89

910
## Changes in 5.9.0

scripts/JSRootCore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595

9696
"use strict";
9797

98-
JSROOT.version = "5.9.x 9/10/2020";
98+
JSROOT.version = "5.9.x 27/11/2020";
9999

100100
JSROOT.source_dir = "";
101101
JSROOT.source_min = false;

scripts/JSRootPainter.hierarchy.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,13 @@
14561456
find_next();
14571457
}
14581458

1459+
HierarchyPainter.prototype.canExpand = function(item) {
1460+
if (!item) return false;
1461+
if (item._expand) return true;
1462+
var handle = JSROOT.getDrawHandle(item._kind, "::expand");
1463+
return handle && (handle.expand_item || handle.expand);
1464+
}
1465+
14591466
HierarchyPainter.prototype.expand = function(itemname, call_back, d3cont, silent) {
14601467
var hpainter = this, hitem = this.Find(itemname);
14611468

scripts/JSRootPainter.jquery.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,11 @@
743743
var hitem = h ? h : this.h;
744744

745745
if (!('_childs' in hitem)) {
746-
if (!isopen || this.with_icons || (!hitem._expand && (hitem._more !== true))) return false;
746+
if (!isopen) return false;
747+
if (this.with_icons) {
748+
// in normal hierarchy check precisely if item can be expand
749+
if (!hitem._more && !hitem._expand && !this.canExpand(hitem)) return false;
750+
}
747751
this.expand(this.itemFullName(hitem));
748752
if (hitem._childs) hitem._isopen = true;
749753
return true;

0 commit comments

Comments
 (0)