Skip to content

Commit 099d933

Browse files
committed
When float browser exceed drawing area size, park it
1 parent 53a419d commit 099d933

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

scripts/JSRootPainter.jquery.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@
468468
}
469469

470470
this.addItemHtml(hitem, d3cont, "update");
471+
472+
if (this.browser_kind === "float")
473+
this.AdjustFloatBrowserSize(null, true);
471474
}
472475

473476
JSROOT.HierarchyPainter.prototype.UpdateBackground = function(hitem, scroll_into_view) {
@@ -824,20 +827,29 @@
824827
.css('left', left+'px').css('top', top+'px');
825828
}
826829

827-
JSROOT.HierarchyPainter.prototype.AdjustFloatBrowserSize = function(jmain) {
828-
if (!jmain) return;
830+
JSROOT.HierarchyPainter.prototype.AdjustFloatBrowserSize = function(jmain, onlycheckmax) {
831+
if (!jmain) {
832+
if (!this.gui_div) return;
833+
jmain = $("#" + this.gui_div + " .jsroot_browser");
834+
}
835+
if (!jmain.length) return;
829836

830837
var area = jmain.find(".jsroot_browser_area"),
831838
cont = jmain.find(".jsroot_browser_hierarchy"),
832839
chld = cont.children(":first");
833840

841+
if (onlycheckmax) {
842+
if (area.parent().innerHeight() - 10 < area.innerHeight())
843+
area.css('bottom', '0px').css('top','0px');
844+
return;
845+
}
846+
834847
if (!chld.length) return;
835848

836849
var h1 = cont.innerHeight(),
837850
h2 = chld.innerHeight();
838851

839-
if ((h2!==undefined) && (h2<h1*0.7))
840-
area.css('bottom', ''); // .css('height', (cont.offset().top + h2 + 10) + 'px');
852+
if ((h2!==undefined) && (h2<h1*0.7)) area.css('bottom', '');
841853
}
842854

843855
JSROOT.HierarchyPainter.prototype.ToggleBrowserKind = function(kind) {

0 commit comments

Comments
 (0)