Skip to content

Commit 41b24f1

Browse files
committed
InfoPanel scroll into view when opened
1 parent 00badb8 commit 41b24f1

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

build/nodegame-window.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3742,6 +3742,10 @@
37423742
this.isVisible = true;
37433743
// Must be at the end.
37443744
W.adjustHeaderOffset(true);
3745+
// Scroll into view.
3746+
if ('function' === typeof this.infoPanelDiv.scrollIntoView) {
3747+
this.infoPanelDiv.scrollIntoView({ behavior: 'smooth' });
3748+
}
37453749
};
37463750

37473751
/**

build/nodegame-window.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/InfoPanel.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@
258258
this.isVisible = true;
259259
// Must be at the end.
260260
W.adjustHeaderOffset(true);
261+
// Scroll into view.
262+
if ('function' === typeof this.infoPanelDiv.scrollIntoView) {
263+
this.infoPanelDiv.scrollIntoView({ behavior: 'smooth' });
264+
}
261265
};
262266

263267
/**

0 commit comments

Comments
 (0)