[SOLVED] Detect if dialog.preloader is open

Hullo team,

I am confused. I know the dialog component has event methods attached to it.
How do I use them, I want to detect if the dialog is open, so I can close it…

                if(app.dialog.preloader.opened){
                    app.dialog.close();
                }

is this the right way?

var dialog = app.dialog.preloader();

if (dialog.opened) {
  // ...
}
1 Like

Awesome, thanks Vlad, that did it!