Deactivate Menu Widget when playing video

Hi…

I created a widget for my menu on the left side. It is always on screen, I only change the width when focused. Now I want to deactivate the menu, when playing fullscreen video. How can I access the widget from a page where the video is playing?
I tried it with signal, but it did not work.

Thanks…

Hi @daniela.heinrich . You should be able to access your widgets from any Lightning component via the this.widgets property.

In this example, I’ve declared a widget called Menu:

static _template() {
    return {
      Pages: {},
      Widgets: {
        Menu: {
          type: Menu,
        },
      },
    };
  }

Then, from, let’s say, my Homepage component, I can do the following, assuming my Menu component has a property called hideMenu, which when set to true will change its opacity to 0:

this.widgets.menu.hideMenu = true;

You can find the relevant documentation here:

@eduardo.guzman thank you for the hint.
this did not work for me, but this works:

this.widgets.menu.patch({
	alpha: 0
});