Skip to content

Commit ab2dbfe

Browse files
committed
Fix - support TFolder browsing
1 parent b9c1f9f commit ab2dbfe

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

scripts/JSRootPainter.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6561,6 +6561,25 @@
65616561
this.clear(true);
65626562
}
65636563

6564+
JSROOT.Painter.FolderHierarchy = function(item, obj) {
6565+
6566+
if ((obj==null) || !('fFolders' in obj) || (obj.fFolders==null)) return false;
6567+
6568+
if (obj.fFolders.arr.length===0) { item._more = false; return true; }
6569+
6570+
item._childs = [];
6571+
6572+
for ( var i = 0; i < obj.fFolders.arr.length; ++i) {
6573+
var chld = obj.fFolders.arr[i];
6574+
item._childs.push( {
6575+
_name : chld.fName,
6576+
_kind : "ROOT." + chld._typename,
6577+
_readobj : chld
6578+
});
6579+
}
6580+
return true;
6581+
}
6582+
65646583
JSROOT.Painter.ListHierarchy = function(folder, lst) {
65656584
if (lst._typename != 'TList' && lst._typename != 'TObjArray' && lst._typename != 'TClonesArray') return false;
65666585

@@ -8449,7 +8468,7 @@
84498468
JSROOT.addDrawFunc({ name: /^TGeo/, icon: 'img_histo3d', prereq: "geom", func: "JSROOT.Painter.drawGeoObject", opt: "all" });
84508469
// these are not draw functions, but provide extra info about correspondent classes
84518470
JSROOT.addDrawFunc({ name: "kind:Command", icon: "img_execute", execute: true });
8452-
JSROOT.addDrawFunc({ name: "TFolder", icon: "img_folder", icon2: "img_folderopen", noinspect: true });
8471+
JSROOT.addDrawFunc({ name: "TFolder", icon: "img_folder", icon2: "img_folderopen", noinspect: true, expand: JSROOT.Painter.FolderHierarchy });
84538472
JSROOT.addDrawFunc({ name: "TTree", icon: "img_tree", noinspect:true });
84548473
JSROOT.addDrawFunc({ name: "TNtuple", icon: "img_tree", noinspect:true });
84558474
JSROOT.addDrawFunc({ name: "TBranch", icon: "img_branch", noinspect:true });

0 commit comments

Comments
 (0)