!7 module YesPopupModule { transient YesPopup popup; transient S moduleID; // which module are we showing the popup for void cleanMeUp { hidePopup(); } void hidePopup { removeFromParent(popup); popup = null; moduleID = null; } // API void showYesPopup(S moduleID, Component component, O... _) { hidePopup(); popup = showYesToAcceptPopup(component, _); this.moduleID = moduleID; } void hideYesPopup(S moduleID) { if (eq(moduleID, this.moduleID)) hidePopup(); } }