From 09659ff25b8a5d92d183a455bb29ff003426305f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 12 Jan 2021 11:51:45 +0100 Subject: [PATCH] firmware: disable autoscroll if client position differs; closes #4545 This excludes the "reset", i.e. when the action was done or the page loads initially with the previous log file. --- src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt b/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt index 90debb012..a1264ef35 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt @@ -313,8 +313,13 @@ function trackStatus() { ajaxGet('/api/core/firmware/upgradestatus', {}, function(data, status) { if (data['log'] != undefined) { + var autoscroll = $('#update_status')[0].scrollTop + + $('#update_status')[0].clientHeight === + $('#update_status')[0].scrollHeight; $('#update_status').html(data['log']); - $('#update_status').scrollTop($('#update_status')[0].scrollHeight); + if (autoscroll) { + $('#update_status').scrollTop($('#update_status')[0].scrollHeight); + } } if (data['status'] == 'done') { $("#upgrade_progress_maj").removeClass("fa fa-spinner fa-pulse");