Skip to content

Commit 0a244d2

Browse files
committed
Correctly set browser buttons positions (#128)
When simpleGUI use not complete browser area, one should correctly take into account offsets.
1 parent b98d835 commit 0a244d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/JSRootPainter.jquery.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,10 @@
818818
var jmain = $("#"+this.gui_div+" .jsroot_browser"), top = 7, left = 7;
819819

820820
if (this.browser_visible) {
821-
var area = jmain.find(".jsroot_browser_area");
822-
top = area.offset().top + 7;
823-
left = area.offset().left + area.innerWidth() - 27;
821+
var area = jmain.find(".jsroot_browser_area"),
822+
off0 = jmain.offset(), off1 = area.offset();
823+
top = off1.top - off0.top + 7;
824+
left = off1.left - off0.left + area.innerWidth() - 27;
824825
}
825826

826827
jmain.find(".jsroot_browser_btns")

0 commit comments

Comments
 (0)