diff --git a/src/core/components/context-menu/context-menu-popover.scss b/src/core/components/context-menu/context-menu-popover.scss index 128643a79..61afb48a1 100644 --- a/src/core/components/context-menu/context-menu-popover.scss +++ b/src/core/components/context-menu/context-menu-popover.scss @@ -3,9 +3,3 @@ ion-list { padding: 0; } - -ion-icon[slot=start] { - @include margin-horizontal(0, 10px); - width: 0.8em; - height: 0.8em; -} diff --git a/src/core/components/context-menu/context-menu-popover.ts b/src/core/components/context-menu/context-menu-popover.ts index 7f473f9c8..0961792c8 100644 --- a/src/core/components/context-menu/context-menu-popover.ts +++ b/src/core/components/context-menu/context-menu-popover.ts @@ -28,14 +28,12 @@ import { CoreContextMenuItemComponent } from './context-menu-item'; }) export class CoreContextMenuPopoverComponent { - title: string; uniqueId: string; items: CoreContextMenuItemComponent[]; constructor( navParams: NavParams, ) { - this.title = navParams.get('title'); this.items = navParams.get('items') || []; this.uniqueId = navParams.get('id'); } diff --git a/src/core/components/context-menu/context-menu.ts b/src/core/components/context-menu/context-menu.ts index 1f1d679da..bbbbca9ab 100644 --- a/src/core/components/context-menu/context-menu.ts +++ b/src/core/components/context-menu/context-menu.ts @@ -32,9 +32,15 @@ import { CoreDirectivesRegistry } from '@singletons/directives-registry'; export class CoreContextMenuComponent implements OnInit, OnDestroy { @Input() icon = 'ellipsis-vertical'; // Icon to be shown on the navigation bar. Default: Kebab menu icon. - @Input() title?: string; // Text to be shown on the top of the popover. @Input('aria-label') ariaLabel?: string; // Aria label to be shown on the top of the popover. + /** + * Title to be shown on the top of the popover. + * + * @deprecated since 4.4. Use aria-label instead. + */ + @Input() title?: string; // Text to be shown on the top of the popover. + hideMenu = true; // It will be unhidden when items are added. uniqueId: string; @@ -68,7 +74,7 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy { * @inheritdoc */ ngOnInit(): void { - this.ariaLabel = this.ariaLabel || this.title || Translate.instant('core.displayoptions'); + this.ariaLabel = this.ariaLabel || Translate.instant('core.displayoptions'); } /** @@ -81,7 +87,7 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy { // All items were moved to the "parent" menu. Add the item in there. this.parentContextMenu.addItem(item); - if (this.itemsMovedToParent.indexOf(item) == -1) { + if (this.itemsMovedToParent.indexOf(item) === -1) { this.itemsMovedToParent.push(item); } } else if (this.items.indexOf(item) == -1) { @@ -181,7 +187,6 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy { event, component: CoreContextMenuPopoverComponent, componentProps: { - title: this.title, items: this.items, }, id: this.uniqueId, diff --git a/src/core/components/context-menu/core-context-menu-popover.html b/src/core/components/context-menu/core-context-menu-popover.html index 4bcb093e2..eda89d1e4 100644 --- a/src/core/components/context-menu/core-context-menu-popover.html +++ b/src/core/components/context-menu/core-context-menu-popover.html @@ -1,22 +1,15 @@ - - {{title}} - -

- -

+

{{ item.content }}

-

- -

+

{{ item.content }}