diff options
author | silverwind <me@silverwind.io> | 2020-11-30 20:51:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 14:51:48 -0500 |
commit | 6e14773c44d5c85e4786c08fde32786092570385 (patch) | |
tree | 20e4056d53a49ab0e6441a90cd4e8d0a2738859b | |
parent | 25421f08c0448d8695ea7546038db18579a82541 (diff) | |
download | gitea-6e14773c44d5c85e4786c08fde32786092570385.tar.gz gitea-6e14773c44d5c85e4786c08fde32786092570385.zip |
Fix bogus http requests on diffs (#13760) (#13761)
The .blob-excerpt elements don't have these data attributes in some
cases resulting in bogus http request when expanding a diff and clicking
into the expanded area. This prevents those.
Should backport to 1.13.
Fixes: https://github.com/go-gitea/gitea/issues/13759
-rw-r--r-- | web_src/js/index.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index 1c479d0e7d..2e7b13cb64 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2089,6 +2089,7 @@ function initCodeView() { }); $(document).on('click', '.blob-excerpt', async ({currentTarget}) => { const {url, query, anchor} = currentTarget.dataset; + if (!url) return; const blob = await $.get(`${url}?${query}&anchor=${anchor}`); currentTarget.closest('tr').outerHTML = blob; }); |