|
468 | 468 | } |
469 | 469 |
|
470 | 470 | this.addItemHtml(hitem, d3cont, "update"); |
| 471 | + |
| 472 | + if (this.browser_kind === "float") |
| 473 | + this.AdjustFloatBrowserSize(null, true); |
471 | 474 | } |
472 | 475 |
|
473 | 476 | JSROOT.HierarchyPainter.prototype.UpdateBackground = function(hitem, scroll_into_view) { |
|
824 | 827 | .css('left', left+'px').css('top', top+'px'); |
825 | 828 | } |
826 | 829 |
|
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; |
829 | 836 |
|
830 | 837 | var area = jmain.find(".jsroot_browser_area"), |
831 | 838 | cont = jmain.find(".jsroot_browser_hierarchy"), |
832 | 839 | chld = cont.children(":first"); |
833 | 840 |
|
| 841 | + if (onlycheckmax) { |
| 842 | + if (area.parent().innerHeight() - 10 < area.innerHeight()) |
| 843 | + area.css('bottom', '0px').css('top','0px'); |
| 844 | + return; |
| 845 | + } |
| 846 | + |
834 | 847 | if (!chld.length) return; |
835 | 848 |
|
836 | 849 | var h1 = cont.innerHeight(), |
837 | 850 | h2 = chld.innerHeight(); |
838 | 851 |
|
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', ''); |
841 | 853 | } |
842 | 854 |
|
843 | 855 | JSROOT.HierarchyPainter.prototype.ToggleBrowserKind = function(kind) { |
|
0 commit comments