aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/index.js')
-rw-r--r--web_src/js/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index cb1d39e62d..30a3d26ce4 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -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'));