Detect if a sheet is open or not


#1

Once a sheet has been created I can get the instance by using app.sheet.get()

console.log(app.sheet.get('#my-sheet'));

But how can I detect if it is open or closed?


#2
var sheet = app.sheet.get('#my-sheet');
var opened = sheet.$el.hasClass('modal-in');

#3

Thank you.
I dug deeper into the Dom element after posting that and figured it out, sometimes it’s just the process of posting a question that helps you to figure it out yourself. :slightly_smiling_face:
I had to check for sheet too obviously:

const sheet = app.sheet.get('#my-sheet');
var opened = sheet ? sheet.$el.hasClass('modal-in') : null;