From 97f08e6540b2fd773bbdf120aaef25584b4d7de3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 19 Mar 2024 10:40:38 +0800 Subject: [PATCH] * Fix bug #47077, adjust dom selector for repo view. --- module/repo/js/common.ui.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/module/repo/js/common.ui.js b/module/repo/js/common.ui.js index fa370c702c..3dab12f745 100644 --- a/module/repo/js/common.ui.js +++ b/module/repo/js/common.ui.js @@ -61,16 +61,17 @@ function arrowTabs(domID, shift, hideRightBtn) { if($('#' + domID).html() == '') return; - var hasParent = $('#' + domID + ' .btn-left').length; - var $leftBtn = hasParent ? $('#' + domID + ' .btn-left') : $('.btn-left'); - var $rightBtn = hasParent ? $('#' + domID + ' .btn-right') : $('.btn-right'); + var hasParent = $('#' + domID + ' > .btn-left').length; + var $leftBtn = hasParent ? $('#' + domID + ' > .btn-left') : $('.btn-left'); + var $rightBtn = hasParent ? $('#' + domID + ' > .btn-right') : $('.btn-right'); $leftBtn.show(); $rightBtn.show(); if(hideRightBtn) $rightBtn.hide(); var tabItemWidth = 0; - if($('#' + domID + ' > .nav-tabs')[0]) tabItemWidth = $('#' + domID + ' > .nav-tabs')[0].clientWidth; + const $tabs = $('#' + domID + ' > .tabs-header > .nav-tabs')[0]; + if($tabs) tabItemWidth = $tabs.clientWidth; var tabsWidth = $('#' + domID)[0].clientWidth; if($('#' + domID + ' .close-bugs').length) tabsWidth = tabsWidth * 0.7; @@ -78,7 +79,7 @@ function arrowTabs(domID, shift, hideRightBtn) { $leftBtn.hide(); $rightBtn.hide(); - $('#' + domID + ' > .nav-tabs')[0].style.transform = 'translateX(0px)'; + $tabs.style.transform = 'translateX(0px)'; return; } @@ -97,7 +98,7 @@ function arrowTabs(domID, shift, hideRightBtn) if(domID == 'monacoTabs' && distance < -60) distance = distance + 60; - $('#' + domID + ' > .nav-tabs')[0].style.transform = 'translateX('+ distance +'px)'; + $tabs.style.transform = 'translateX('+ distance +'px)'; } /**