Skip to content

Commit

Permalink
MOBILE-3947 chore: Remove EventEmitter observer deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Nov 29, 2023
1 parent 2d141bc commit d72e8d4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/components/context-menu/context-menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class CoreContextMenuItemComponent implements OnInit, OnDestroy, OnChange
ngOnInit(): void {
// Initialize values.
this.priority = this.priority || 1;
this.hasAction = !!this.action && this.action.observers.length > 0;
this.hasAction = !!this.action && this.action.observed;
this.ariaAction = this.ariaAction || this.content;

if (this.hasAction) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/context-menu/context-menu-popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class CoreContextMenuPopoverComponent {
item.toggle = !item.toggle;
}

if (!!item.action && item.action.observers.length > 0) {
if (!!item.action && item.action.observed) {
event.preventDefault();
event.stopPropagation();

Expand All @@ -74,7 +74,7 @@ export class CoreContextMenuPopoverComponent {
}

item.action.emit(() => this.closeMenu(item));
} else if (item.closeOnClick && (item.href || (!!item.onClosed && item.onClosed.observers.length > 0))) {
} else if (item.closeOnClick && (item.href || (!!item.onClosed && item.onClosed.observed))) {
this.closeMenu(item);
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/components/local-file/local-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class CoreLocalFileComponent implements OnInit {
e.preventDefault();
e.stopPropagation();

if (!isOpenButton && CoreUtils.isTrueOrOne(this.overrideClick) && this.onClick.observers.length) {
if (!isOpenButton && CoreUtils.isTrueOrOne(this.overrideClick) && this.onClick.observed) {
this.onClick.emit();

return;
Expand Down
2 changes: 1 addition & 1 deletion src/core/directives/format-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
return;
}

if (this.onClick.observers.length > 0) {
if (this.onClick.observed) {
this.onClick.emit();

return;
Expand Down
2 changes: 1 addition & 1 deletion src/core/directives/supress-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class CoreSupressEventsDirective implements OnInit {
* Initialize event listeners.
*/
ngOnInit(): void {
if (this.onClick.observers.length == 0) {
if (!this.onClick.observed) {
CoreLogger.getInstance('CoreSupressEventsDirective')
.error('No onClick output was defined causing this directive to fail', this.element);

Expand Down

0 comments on commit d72e8d4

Please sign in to comment.