From ecd3d712aad4ac37f399c90f4bf9258bfe483b9a Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Mon, 7 May 2018 15:55:00 +0300 Subject: Developed disable navigation mechanism Added a mechanism to disable and enable the navigation when waiting for a response from a plugin Change-Id: I11cba9a7fc2a32e3d3d32fb9cf9f0590900fe73b Issue-ID: SDC-1277 Signed-off-by: Idan Amit --- catalog-ui/src/app/models/base-pubsub.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'catalog-ui/src/app/models') diff --git a/catalog-ui/src/app/models/base-pubsub.ts b/catalog-ui/src/app/models/base-pubsub.ts index b9ff788a57..c4b109f1d5 100644 --- a/catalog-ui/src/app/models/base-pubsub.ts +++ b/catalog-ui/src/app/models/base-pubsub.ts @@ -97,6 +97,12 @@ export class BasePubSub { } } + public isWaitingForEvent(eventName: string) : boolean { + return Array.from(this.eventsToWait.values()).some((eventsList: Array) => + eventsList.indexOf(eventName) !== -1 + ); + } + protected onMessage(event: any) { if (this.subscribers.has(event.data.originId)) { this.eventsCallbacks.forEach((callback: Function) => { -- cgit 1.2.3-korg