mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
refactor: improve scroll position handling in BodyInlineJS.php
- Changed the 'top' variable to use parseInt for better type handling. - Updated the scrollTop logic for clarity and consistency.
This commit is contained in:
@@ -283,8 +283,10 @@ $(function() {
|
||||
$(this).attr('onsubmit','clearTimeout(timers.flashReport);escapeQuotes(this);'+onsubmit);
|
||||
}
|
||||
});
|
||||
var top = ($.cookie('top')||0);
|
||||
if (top>0) {$('html,body').scrollTop(top);}
|
||||
const top = parseInt($.cookie('top') || '0', 10);
|
||||
if (top > 0) {
|
||||
$('html, body').scrollTop(top);
|
||||
}
|
||||
$.removeCookie('top');
|
||||
if ($.cookie('addAlert') != null) bannerAlert(addAlert.text,addAlert.cmd,addAlert.plg,addAlert.func);
|
||||
<?if ($safemode):?>
|
||||
|
||||
Reference in New Issue
Block a user