1
0
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:
checktheroads
2021-07-17 21:24:20 -07:00
parent 29ee3e5ac0
commit c14b546d5f
14 changed files with 197 additions and 197 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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;