File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
public/themes/pterodactyl Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 6161 opacity : .5 ;
6262 font-size : 16px ;
6363 cursor : pointer;
64+ z-index : 10 ;
6465}
6566
6667.terminal-notify : hover {
Original file line number Diff line number Diff line change @@ -116,13 +116,15 @@ $(document).ready(function () {
116116} ) ;
117117
118118$terminal . on ( 'scroll' , function ( ) {
119- if ( $ ( this ) . scrollTop ( ) + $ ( this ) . innerHeight ( ) + 50 < $ ( this ) [ 0 ] . scrollHeight ) {
120- $scrollNotify . removeClass ( 'hidden' ) ;
121- } else {
119+ if ( isTerminalScrolledDown ( ) ) {
122120 $scrollNotify . addClass ( 'hidden' ) ;
123121 }
124122} ) ;
125123
124+ function isTerminalScrolledDown ( ) {
125+ return $terminal . scrollTop ( ) + $terminal . innerHeight ( ) + 50 > $terminal [ 0 ] . scrollHeight ;
126+ }
127+
126128window . scrollToBottom = function ( ) {
127129 $terminal . scrollTop ( $terminal [ 0 ] . scrollHeight ) ;
128130} ;
@@ -148,16 +150,20 @@ function pushToTerminal(string) {
148150 }
149151
150152 if ( TerminalQueue . length > 0 ) {
153+ var scrolledDown = isTerminalScrolledDown ( ) ;
154+
151155 for ( var i = 0 ; i < CONSOLE_PUSH_COUNT && TerminalQueue . length > 0 ; i ++ ) {
152156 pushToTerminal ( TerminalQueue [ 0 ] ) ;
153157
154- if ( ! $scrollNotify . is ( ':visible' ) ) {
155- window . scrollToBottom ( ) ;
156- }
157-
158158 window . ConsoleElements ++ ;
159159 TerminalQueue . shift ( ) ;
160160 }
161+
162+ if ( scrolledDown ) {
163+ window . scrollToBottom ( ) ;
164+ } else if ( $scrollNotify . hasClass ( 'hidden' ) ) {
165+ $scrollNotify . removeClass ( 'hidden' ) ;
166+ }
161167
162168 var removeElements = window . ConsoleElements - CONSOLE_OUTPUT_LIMIT ;
163169 if ( removeElements > 0 ) {
You can’t perform that action at this time.
0 commit comments