The undelegateModalEvents function is not called when a modal is canceled or closed for another reason. It looks as though the modal checks if we have a viewContainer, here
and here
, except
@regionEnabled does not seem to be set anywhere else in the code. That means
destroy will always be called on a successful
triggerCancel and
triggerSubmit.
So, I think we should call undelegateModalEvents every time destroy is called in order to always remove events from the inactive modal and return the modal state back to inactive (@active = false called only in the undelegateModelEvents function here
).
The
undelegateModalEventsfunction is not called when a modal is canceled or closed for another reason. It looks as though the modal checks if we have aviewContainer, herebackbone.modal/src/backbone.modal.coffee
Line 249 in daed180
backbone.modal/src/backbone.modal.coffee
Line 260 in daed180
@regionEnableddoes not seem to be set anywhere else in the code. That meansdestroywill always be called on a successfultriggerCancelandtriggerSubmit.So, I think we should call
undelegateModalEventsevery timedestroyis called in order to always remove events from the inactive modal and return the modal state back to inactive (@active = falsecalled only in theundelegateModelEventsfunction herebackbone.modal/src/backbone.modal.coffee
Line 119 in daed180