Hide notifications when clicking dropdown button
This commit is contained in:
parent
a8387cb964
commit
f345910116
|
|
@ -1061,6 +1061,7 @@ declare namespace LocalJSX {
|
|||
"icon"?: any;
|
||||
"items"?: Array<DropdownButtonItem>;
|
||||
"onItemSelected"?: (event: ElsaDropdownButtonCustomEvent<DropdownButtonItem>) => void;
|
||||
"onMenuOpened"?: (event: ElsaDropdownButtonCustomEvent<void>) => void;
|
||||
"origin"?: DropdownButtonOrigin;
|
||||
"text"?: string;
|
||||
"theme"?: ('Primary' | 'Secondary');
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export class DropdownButton {
|
|||
@Prop() public items: Array<DropdownButtonItem> = [];
|
||||
@Prop() public theme: ('Primary' | 'Secondary') = 'Primary';
|
||||
@Event() public itemSelected: EventEmitter<DropdownButtonItem>
|
||||
@Event() public menuOpened: EventEmitter<void>
|
||||
|
||||
private contextMenu: HTMLElement;
|
||||
private element: HTMLElement;
|
||||
|
|
@ -102,8 +103,10 @@ export class DropdownButton {
|
|||
}
|
||||
|
||||
private toggleMenu() {
|
||||
if (!!this.contextMenu)
|
||||
if (!!this.contextMenu) {
|
||||
toggle(this.contextMenu);
|
||||
this.menuOpened.emit();
|
||||
}
|
||||
}
|
||||
|
||||
private getOriginClass(): string {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {Component, Event, EventEmitter, h, Prop} from '@stencil/core';
|
||||
import {DropdownButtonItem} from "../../../components/shared/dropdown-button/models";
|
||||
import NotificationService from "../../notifications/notification-service";
|
||||
|
||||
export interface PublishClickedArgs {
|
||||
begin: () => void;
|
||||
|
|
@ -73,6 +74,6 @@ export class PublishButton {
|
|||
handler: publishing ? () => {} : () => this.onPublishClick()
|
||||
}
|
||||
|
||||
return <elsa-dropdown-button text={mainItem.text} handler={mainItem.handler} items={items} icon={this.publishingIcon()} />
|
||||
return <elsa-dropdown-button text={mainItem.text} handler={mainItem.handler} items={items} icon={this.publishingIcon()} onMenuOpened={() => NotificationService.hideAllNotifications()} />
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue