close a dialog on location change

Optionally close a dialog when location is changed, e.g. a view is changed.
Merge pull request #96 from bgse/close-dialog-on-navigation

close a dialog on location change fixes #95