This does successfully hide the scrollbars when the modal dialog is opened, however I have been unable to set them back to "auto" when the dialog is closed.

Naturally, I tried window.unload, but clicking the "X" or the "Close" button do not fire window.unload... What event can I capture to reset body overflow here? I am looking for a universal way to achieve this, without specifically setting click events for buttons, since there are a number of ways to close a dialog.

SharePoint has some underlying scripts that control the scroll bars in some pages. I expect that you may spend a lot of time on this for negligible results.
–
Marc D AndersonApr 11 '13 at 15:39

Was able to achieve what I wanted by overriding the default SP.UI.ModalDialog.showModalDialog behavior in my Master page. Was quite simple once I realized that could be done. Answer is below.
–
Dom RoccoApr 11 '13 at 16:09

3 Answers
3

Who's calling the modal form? If you are by using SP.UI.ModalDialog.showModalDialog(options)? If so, you just pass a callback function into the parameters. I'm sorry for not being more useful, but look into that SP.UI.ModalDialog namespace...there might be something you can add to the modal forms themselves that would kick off once they're closed.

This needs to work for every modal dialog on the site, so while I have control over some of them that I'm launching myself, there are still those that are popping up from Title links and Ribbon buttons, etc. So I'm really looking for a universal method of accomplishing this through Javascript.
–
Dom RoccoApr 11 '13 at 11:06

Will this modify all dialogs or just those that are launched by calling "OpenDialog" manually? I'm looking for an approach that is comprehensive in that it affects every modal dialog on the site.
–
Dom RoccoApr 11 '13 at 11:08