diff options
author | silverwind <me@silverwind.io> | 2020-07-29 20:44:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-29 14:44:23 -0400 |
commit | 2fd78c151e0e49db113078095f1d9e8c7478e828 (patch) | |
tree | 19526559ed4148f93355786d829c44113cdac27c /web_src/js/features | |
parent | 2f6aadffa8243736825564cd1ce32d0d5a1eb391 (diff) | |
download | gitea-2fd78c151e0e49db113078095f1d9e8c7478e828.tar.gz gitea-2fd78c151e0e49db113078095f1d9e8c7478e828.zip |
Move jquery-minicolors to npm/webpack (#12305)
* Move jquery-minicolors to npm/webpack
- Unvendor and add as npm dependency
- Removed unneeded backend variable
- Fixed existing bug where picker would previously initizalize to the
same green color when editing a label.
There was probably a version bump because the previous version was
over 3 years old but it seems to be compatible.
* use file-loader
* trailing comma and comment update
* misc tweaks
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'web_src/js/features')
-rw-r--r-- | web_src/js/features/colorpicker.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/web_src/js/features/colorpicker.js b/web_src/js/features/colorpicker.js new file mode 100644 index 0000000000..11c5f26fa4 --- /dev/null +++ b/web_src/js/features/colorpicker.js @@ -0,0 +1,10 @@ +export default async function createColorPicker($els) { + if (!$els || !$els.length) return; + + await Promise.all([ + import(/* webpackChunkName: "minicolors" */'@claviska/jquery-minicolors'), + import(/* webpackChunkName: "minicolors" */'@claviska/jquery-minicolors/jquery.minicolors.css'), + ]); + + $els.minicolors(); +} |