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 2020/03/11 17:04:17 UTC

[myfaces-tobago] branch master updated: fix tobago-dropdown custom events

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4a98883  fix tobago-dropdown custom events
4a98883 is described below

commit 4a9888350e9b76d8dd7376e2c8d74f073904efa5
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Mar 11 13:34:59 2020 +0100

    fix tobago-dropdown custom events
    
    * show events are now dispatched if dropdown is opened
    * hide events are now dispatched if dropdown is closed
---
 .../tobago-theme-standard/src/main/npm/ts/tobago-dropdown.ts      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-dropdown.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-dropdown.ts
index e0da2ab..0c42861 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-dropdown.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-dropdown.ts
@@ -128,7 +128,7 @@ class Dropdown extends HTMLElement {
   }
 
   openDropdown(): void {
-    this.dispatchEvent(new CustomEvent(Event.HIDE));
+    this.dispatchEvent(new CustomEvent(Event.SHOW));
 
     if (!this.inStickyHeader()) {
       this.menuStore.appendChild(this.dropdownMenu);
@@ -142,14 +142,14 @@ class Dropdown extends HTMLElement {
     }
 
     this.dropdownMenu.classList.add("show");
-    this.dispatchEvent(new CustomEvent(Event.HIDDEN));
+    this.dispatchEvent(new CustomEvent(Event.SHOWN));
   }
 
   closeDropdown(): void {
-    this.dispatchEvent(new CustomEvent(Event.SHOW));
+    this.dispatchEvent(new CustomEvent(Event.HIDE));
     this.dropdownMenu.classList.remove("show");
     this.appendChild(this.dropdownMenu);
-    this.dispatchEvent(new CustomEvent(Event.SHOWN));
+    this.dispatchEvent(new CustomEvent(Event.HIDDEN));
   }
 
   private get toggleButton(): HTMLElement {