mirror of
https://github.com/go-gitea/gitea
synced 2024-08-27 17:53:41 +02:00
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>
17 lines
548 B
JavaScript
17 lines
548 B
JavaScript
import $ from 'jquery';
|
|
import {createColorPicker} from '../colorpicker.js';
|
|
|
|
export function initCompColorPicker() {
|
|
(async () => {
|
|
await createColorPicker(document.querySelectorAll('.color-picker'));
|
|
|
|
for (const el of document.querySelectorAll('.precolors .color')) {
|
|
el.addEventListener('click', (e) => {
|
|
const color = e.target.getAttribute('data-color-hex');
|
|
const parent = e.target.closest('.color.picker');
|
|
$(parent.querySelector('.color-picker')).minicolors('value', color);
|
|
});
|
|
}
|
|
})();
|
|
}
|