Bug #2791 #2778: Do not close modal windows on refresh