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:
Zack Spear
2025-05-07 16:15:45 -07:00
parent 98c5ef3a19
commit ad342e68b6

View File

@@ -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):?>