Improve "language stats" UI (#26968)

Before:

* The layout is quite complex 
* The UI flickers when switch the stats (https://try.gitea.io/)

After:

* Simplify the code
* The UI doesn't flicker
This commit is contained in:
wxiaoguang 2023-09-10 18:27:23 +08:00 committed by GitHub
parent a20e0affba
commit dd6e8ab57b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 147 deletions

View file

@ -1,5 +1,5 @@
import $ from 'jquery';
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
import {hideElem, showElem} from '../utils/dom.js';
const {csrfToken} = window.config;
@ -91,13 +91,3 @@ export function initRepoCommonFilterSearchDropdown(selector) {
message: {noResults: $dropdown.attr('data-no-results')},
});
}
export function initRepoCommonLanguageStats() {
// Language stats
if ($('.language-stats').length > 0) {
$('.language-stats').on('click', (e) => {
e.preventDefault();
toggleElem($('.language-stats-details, .repository-menu'));
});
}
}