From 6cbac1370937686a331f5289056b093638e035ee Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 27 Aug 2024 11:26:05 +0800 Subject: [PATCH] * [bug#54447] Fix Bug on repo view. --- module/repo/js/monaco.ui.js | 7 ++++--- module/repo/ui/monaco.html.php | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/repo/js/monaco.ui.js b/module/repo/js/monaco.ui.js index 7235578b36..26fd0f7f36 100644 --- a/module/repo/js/monaco.ui.js +++ b/module/repo/js/monaco.ui.js @@ -63,9 +63,9 @@ $('body').off('click', '.dropmenu-tree .dropmenu-item').on('click', '.dropmenu-t openUrl(currentLink, {app: appTab}); }) -$('.repoDropDownMenu').on('click', function() +window.dropdownClick = function(event) { - const url = $(this).data('link'); + const url = $(event).data('link'); const file = $('#monacoTabs .nav-item .active').attr('href').substring(5).replace(/-/g, '='); if(url.indexOf('blame') >=0 && url.indexOf('download') == -1) { @@ -75,8 +75,9 @@ $('.repoDropDownMenu').on('click', function() { window.open(url.replace('{path}', file), '_self'); } + return; -}) +} /** * 打开新tab。 diff --git a/module/repo/ui/monaco.html.php b/module/repo/ui/monaco.html.php index 538ccb586d..1f158b0a04 100644 --- a/module/repo/ui/monaco.html.php +++ b/module/repo/ui/monaco.html.php @@ -58,6 +58,7 @@ div( set::id('monacoTabs'), set::className('relative'), on::click('.monaco-close')->call('closeTab', jsRaw('this')), + on::click('.repoDropDownMenu')->call('dropdownClick', jsRaw('this')), div(setStyle(array('position' => 'absolute', 'width' => '100%', 'height' => '40px', 'background' => '#efefef', 'top' => '0px'))), tabPane (