From 130610523e798b21ee8e22f51dfb48361c11fdac Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Fri, 12 Apr 2024 03:15:02 +0000 Subject: [PATCH] * Fix scrollIntoView without metric. --- module/metric/js/preview.ui.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/metric/js/preview.ui.js b/module/metric/js/preview.ui.js index 85695ecf36b..d8686361967 100644 --- a/module/metric/js/preview.ui.js +++ b/module/metric/js/preview.ui.js @@ -9,7 +9,11 @@ window.afterPageUpdate = function($target, info, options) } window.filterChecked = {}; - if(viewType == 'single') $('.metric-tree .metric-current')[0].scrollIntoView({block: 'center', inline: 'start' }) + if(viewType == 'single') + { + var metricCurrent = $('.metric-tree .metric-current'); + if(metricCurrent.length) metricCurrent[0].scrollIntoView({block: 'center', inline: 'start' }) + } if(viewType == 'multiple') { window.renderCheckedLabel();