Add ability to ignore parent documents

I can't remember exactly, but I made this change a long time ago and I think it was for circumstances where you have enabled dirtyforms in an iframe page, but you don't want to listen to changes outside of the iframe.