mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
#6372: Refactor Select2 naming
This commit is contained in:
@ -185,7 +185,7 @@ function getDisplayName(result: APIObjectBase, select: HTMLSelectElement): strin
|
||||
* Initialize select elements that rely on the NetBox API to build their options.
|
||||
*/
|
||||
export function initApiSelect() {
|
||||
for (const select of getElements<HTMLSelectElement>('.netbox-select2-api')) {
|
||||
for (const select of getElements<HTMLSelectElement>('.netbox-api-select')) {
|
||||
const dependencies = getDependencyIds(select);
|
||||
// Initialize an event, so other elements relying on this element can subscribe to this
|
||||
// element's value.
|
||||
|
@ -16,7 +16,7 @@ function canChangeColor(option: Option | HTMLOptionElement): boolean {
|
||||
* the selected option.
|
||||
*/
|
||||
export function initColorSelect(): void {
|
||||
for (const select of getElements<HTMLSelectElement>('select.netbox-select2-color-picker')) {
|
||||
for (const select of getElements<HTMLSelectElement>('select.netbox-color-select')) {
|
||||
for (const option of select.options) {
|
||||
if (canChangeColor(option)) {
|
||||
// Get the background color from the option's value.
|
||||
|
@ -2,7 +2,7 @@ import SlimSelect from 'slim-select';
|
||||
import { getElements } from '../util';
|
||||
|
||||
export function initStaticSelect() {
|
||||
for (const select of getElements<HTMLSelectElement>('.netbox-select2-static')) {
|
||||
for (const select of getElements<HTMLSelectElement>('.netbox-select-static')) {
|
||||
if (select !== null) {
|
||||
const label = document.querySelector(`label[for=${select.id}]`) as HTMLLabelElement;
|
||||
|
||||
|
Reference in New Issue
Block a user