You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2023/02/14 16:43:11 UTC

[myfaces-tobago] branch tobago-5.x updated: refactor(cleanup): select[One/Many]List

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/tobago-5.x by this push:
     new b0cccbdff5 refactor(cleanup): select[One/Many]List
b0cccbdff5 is described below

commit b0cccbdff59735d329459cba0e76da26b411777c
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Tue Feb 14 17:40:53 2023 +0100

    refactor(cleanup): select[One/Many]List
    
    * make some functions private
---
 .../tobago-theme-standard/src/main/ts/tobago-select-many-list.ts    | 6 +++---
 .../tobago-theme-standard/src/main/ts/tobago-select-one-list.ts     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many-list.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many-list.ts
index 8d72cce5ca..e86d3be9a3 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many-list.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many-list.ts
@@ -65,7 +65,7 @@ class SelectManyList extends SelectListBase {
     this.filterInput.focus({preventScroll: true});
   }
 
-  sync(option: HTMLOptionElement) {
+  private sync(option: HTMLOptionElement) {
     const itemValue = option.value;
     const row: HTMLTableRowElement = this.tbody.querySelector(`[data-tobago-value="${itemValue}"]`);
     if (option.selected) {
@@ -111,7 +111,7 @@ class SelectManyList extends SelectListBase {
     }
   }
 
-  getRowTemplate(value: string, text: string, disabled: boolean, tabIndex: number): string {
+  private getRowTemplate(value: string, text: string, disabled: boolean, tabIndex: number): string {
     return disabled ? `
 <span class="btn-group" role="group" data-tobago-value="${value}">
   <tobago-badge class="badge text-bg-primary btn disabled">${text}</tobago-badge>
@@ -123,7 +123,7 @@ class SelectManyList extends SelectListBase {
 </span>`;
   }
 
-  removeBadge(event: MouseEvent): void {
+  private removeBadge(event: MouseEvent): void {
     const target = <HTMLElement>event.target;
     const group: HTMLElement = target.closest(".btn-group");
     const itemValue = group.dataset.tobagoValue;
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts
index 4002e59f38..29302f8765 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts
@@ -80,7 +80,7 @@ class SelectOneList extends SelectListBase {
     this.sync();
   }
 
-  sync() {
+  private sync() {
     this.rows.forEach((row) => {
       if (row.dataset.tobagoValue === this.hiddenSelect.value) {
         this.spanText = this.hiddenSelect.value;