Skip to content

Commit

Permalink
Rename argument to avoid confustion with other 'options' arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Jan 16, 2025
1 parent 99df272 commit 1a570f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fontra/client/core/ui-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ export function labeledTextInput(label, controller, key, options) {
return items;
}

export function popupSelect(controller, key, options) {
export function popupSelect(controller, key, popupItems) {
function findLabel() {
const option = options.find(({ value }) => value === controller.model[key]);
const option = popupItems.find(({ value }) => value === controller.model[key]);
return option?.label || "";
}

Expand All @@ -190,7 +190,7 @@ export function popupSelect(controller, key, options) {
});

const menu = new PopupMenu(findLabel(), () =>
options.map(({ value, label }) => ({
popupItems.map(({ value, label }) => ({
title: label,
checked: value === controller.model[key],
callback: () => {
Expand All @@ -202,8 +202,8 @@ export function popupSelect(controller, key, options) {
return menu;
}

export function labeledPopupSelect(label, controller, key, options) {
const inputElement = popupSelect(controller, key, options);
export function labeledPopupSelect(label, controller, key, popupItems) {
const inputElement = popupSelect(controller, key, popupItems);
return [labelForElement(label, inputElement), inputElement];
}

Expand Down

0 comments on commit 1a570f9

Please sign in to comment.