Skip to content

Commit 1764be6

Browse files
committed
Allow to activate player also with simple mouse click.
git-svn-id: https://subversion.gsi.de/dabc/trunk/plugins/root/js@2922 bcbf6573-9a26-0410-9ebc-ce4ab7aade96
1 parent 62f0268 commit 1764be6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

scripts/JSRootPainter.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7039,14 +7039,15 @@
70397039

70407040
var kind = node["_kind"];
70417041
if (kind == null) kind = "";
7042-
7042+
70437043
if (kind.indexOf("ROOT.") == 0) cando.typename = kind.slice(5);
70447044

70457045
cando.expand = ('_more' in node);
70467046

7047-
if (node == this.h) {
7048-
cando.ctxt = true;
7049-
} else if (kind == "ROOT.Session") {
7047+
// enable context menu for top item
7048+
if (node === this.h) cando.ctxt = true;
7049+
7050+
if (kind == "ROOT.Session") {
70507051
cando.img1 = "img_globe";
70517052
} else if (kind.match(/^ROOT.TH1/)) {
70527053
cando.img1 = "img_histo1d";
@@ -7092,6 +7093,8 @@
70927093
cando.scan = false;
70937094
cando.display = true;
70947095
}
7096+
7097+
if ('_player' in node) cando.display = true;
70957098

70967099
return cando;
70977100
}
@@ -7276,8 +7279,9 @@
72767279
if (cando.expand && (hitem['_childs'] == null))
72777280
return this.expand(itemname, hitem, node.parent());
72787281

7279-
if (cando.display)
7282+
if (cando.display) {
72807283
return this.display(itemname);
7284+
}
72817285

72827286
if (!('_childs' in hitem) || (hitem === this.h)) return;
72837287
}
@@ -7428,7 +7432,7 @@
74287432

74297433
if (item!=null) {
74307434
var cando = this.CheckCanDo(item);
7431-
if (!cando.display) return this.player(itemname, drawopt, call_back);
7435+
if (!cando.display || ('_player' in item)) return this.player(itemname, drawopt, call_back);
74327436
}
74337437

74347438
if (updating) {
@@ -7800,6 +7804,8 @@
78007804

78017805
var itemname = node.parent().attr('item');
78027806

7807+
console.log("tree_contextmenu " + itemname);
7808+
78037809
var hitem = this.Find(itemname);
78047810
if (hitem==null) return;
78057811

0 commit comments

Comments
 (0)