Overlay should be destroyed together with window
Currently window is being destroyed in MooDialog.destroy, but overlay is left orphaned. To fix this I would suggest the following changes
// Modyfy MooDialog.destroy to fire "destroy" event
destroy: function(){
this.fireEvent('destroy');
this.wrapper.destroy();
},
// handle this event in MooDialog.Fx
onDestroy : function() {
this.overlay.destroy();
}
// finally add "destroy" method to Overlay class
destroy : function() {
this.overlay.destroy();
}