1- import { ChangeDetectorRef , Component , Inject , Injector , Input , OnInit } from '@angular/core' ;
1+ import { AfterViewChecked , ChangeDetectorRef , Component , Inject , Injector , Input , OnInit } from '@angular/core' ;
22import { DOCUMENT } from '@angular/common' ;
33
44import { from , Observable } from 'rxjs' ;
@@ -24,7 +24,7 @@ import { GenericConstructor } from '../../core/shared/generic-constructor';
2424 styleUrls : [ './context-menu.component.scss' ] ,
2525 templateUrl : './context-menu.component.html'
2626} )
27- export class ContextMenuComponent implements OnInit {
27+ export class ContextMenuComponent implements OnInit , AfterViewChecked {
2828
2929 /**
3030 * The related item
@@ -48,6 +48,9 @@ export class ContextMenuComponent implements OnInit {
4848 */
4949 public optionCount = 0 ;
5050
51+ public standAloneEntries$ : Observable < any > ;
52+ public contextEntries$ : Observable < any > ;
53+
5154 /**
5255 * Initialize instance variables
5356 *
@@ -71,6 +74,9 @@ export class ContextMenuComponent implements OnInit {
7174 ] ,
7275 parent : this . injector
7376 } ) ;
77+
78+ this . standAloneEntries$ = this . getStandAloneMenuEntries ( ) ;
79+ this . contextEntries$ = this . getContextMenuEntries ( ) ;
7480 }
7581
7682 /**
@@ -118,10 +124,6 @@ export class ContextMenuComponent implements OnInit {
118124 ) ;
119125 }
120126
121- isItem ( ) : boolean {
122- return this . contextMenuObjectType === DSpaceObjectType . ITEM ;
123- }
124-
125127 ngAfterViewChecked ( ) {
126128 // To check that Context-menu contains options or not
127129 if ( this . _document . getElementById ( 'itemOptionsDropdownMenu' ) ) {
0 commit comments