forked from forgejo/forgejo
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>
This commit is contained in:
parent
2f6aadffa8
commit
2fd78c151e
15 changed files with 36 additions and 366 deletions
|
@ -15,6 +15,7 @@ import initServiceWorker from './features/serviceworker.js';
|
|||
import initMarkdownAnchors from './markdown/anchors.js';
|
||||
import renderMarkdownContent from './markdown/content.js';
|
||||
import attachTribute from './features/tribute.js';
|
||||
import createColorPicker from './features/colorpicker.js';
|
||||
import createDropzone from './features/dropzone.js';
|
||||
import initTableSort from './features/tablesort.js';
|
||||
import ActivityTopAuthors from './components/ActivityTopAuthors.vue';
|
||||
|
@ -134,15 +135,15 @@ function initLabelEdit() {
|
|||
$newLabelPanel.hide();
|
||||
});
|
||||
|
||||
$('.color-picker').each(function () {
|
||||
$(this).minicolors();
|
||||
});
|
||||
createColorPicker($('.color-picker'));
|
||||
|
||||
$('.precolors .color').on('click', function () {
|
||||
const color_hex = $(this).data('color-hex');
|
||||
$('.color-picker').val(color_hex);
|
||||
$('.minicolors-swatch-color').css('background-color', color_hex);
|
||||
});
|
||||
$('.edit-label-button').on('click', function () {
|
||||
$('.color-picker').minicolors('value', $(this).data('color'));
|
||||
$('#label-modal-id').val($(this).data('id'));
|
||||
$('.edit-label .new-label-input').val($(this).data('title'));
|
||||
$('.edit-label .new-label-desc-input').val($(this).data('description'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue