1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 22:47:21 +00:00

Forbid jQuery .css and refactor all usage (#29852)

Tested all functionality. There is a [pre-existing
bug](https://github.com/go-gitea/gitea/issues/29853) when moving a
project panels which is not caused by this refactoring.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2024-03-19 17:28:46 +01:00
committed by GitHub
parent 5a8559ec47
commit fa100618c4
7 changed files with 78 additions and 73 deletions

View File

@ -1,10 +1,12 @@
export async function createColorPicker($els) {
if (!$els || !$els.length) return;
import $ from 'jquery';
export async function createColorPicker(els) {
if (!els.length) return;
await Promise.all([
import(/* webpackChunkName: "minicolors" */'@claviska/jquery-minicolors'),
import(/* webpackChunkName: "minicolors" */'@claviska/jquery-minicolors/jquery.minicolors.css'),
]);
$els.minicolors();
return $(els).minicolors();
}