From ba2ce19c5539229cfeb19e90eb5d7fdab88ed9fa Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 30 Aug 2024 11:39:20 +0800 Subject: [PATCH] * [bug#54759] adjust repo download event. --- module/repo/js/browse.ui.js | 4 ++-- module/repo/ui/browse.html.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/repo/js/browse.ui.js b/module/repo/js/browse.ui.js index 5976efe7f4..1f8e19febe 100644 --- a/module/repo/js/browse.ui.js +++ b/module/repo/js/browse.ui.js @@ -103,11 +103,11 @@ window.renderCommentCell = function(result, {col, row}) }; /* Open download page when downZip btn click. */ -$('.downloadZip-btn').on('click', function() +window.downloadZip = function() { var link = $.createLink('repo', 'downloadCode', 'repoID=' + repo.id + '&branch=' + branch); $.ajaxSubmit({url: link}); -}) +} /* Refresh page when repo changed. */ $('#repo-select').on('change', function() diff --git a/module/repo/ui/browse.html.php b/module/repo/ui/browse.html.php index 9943aed157..0ebc22618a 100644 --- a/module/repo/ui/browse.html.php +++ b/module/repo/ui/browse.html.php @@ -205,6 +205,7 @@ $downloadWg = div setStyle(array('margin-top' => '20px')), btn ( + on::click()->call('downloadZip'), set::icon('down-circle'), set::className('downloadZip-btn'), set::text($lang->repo->downloadZip)