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 (