mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
implemented #2590 - improved color picker with actual colors
This commit is contained in:
@@ -86,6 +86,22 @@ $(document).ready(function() {
|
||||
return rendered_url
|
||||
}
|
||||
|
||||
function colorPickerClassCopy(data, container) {
|
||||
console.log("hello");
|
||||
if (data.element) {
|
||||
$(container).addClass($(data.element).attr("class"));
|
||||
}
|
||||
return data.text;
|
||||
}
|
||||
|
||||
// Color Picker
|
||||
$('.netbox-select2-color-picker').select2({
|
||||
allowClear: true,
|
||||
placeholder: "---------",
|
||||
templateResult: colorPickerClassCopy,
|
||||
templateSelection: colorPickerClassCopy,
|
||||
})
|
||||
|
||||
// Static choice selection
|
||||
$('.netbox-select2-static').select2({
|
||||
allowClear: true,
|
||||
|
Reference in New Issue
Block a user