NSB.Msgbox event listener

Is there an event listener I can use to detect when the NSB.Msgbox is shown and dismissed?

Form example

document.addEventListener("MsgBoxonShow", onMsgboxShow, False);
document.addEventListener("MsgBoxonHide", onMsgboxHide, False);

function onMsgboxShow() {
  // do something
  NSB.ShowProgress(false);
}

function onMsgboxHide() {
  // do something else
  NSB.ShowProgress("Loading...");
}

NSB.MsgBox creates an element called NSB_MsgBox. You can’t define an event for an NSB.MsgBox before it is displayed on the screen: it only gets created when it is called and is destroyed when it is dismissed.

You might be able to do this by catching a click event:

Form1.onclick = function(e){
  console.log(e);
}

This would get called whenever the user clicks on the form You would need to look at the e object to see if it’s something which calls NSB.MsgBox.

I have a hunch there might be better way, but I’m not sure what that is.

Ok, no worries, thank you.

I’ll go through my code and will manually show/hide the ShowProgress where required.