Added a warning when leaving the page.

-- we only prompt if the data is dirty.