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:
parent
a20e0affba
commit
dd6e8ab57b
5 changed files with 65 additions and 147 deletions
|
@ -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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue