Fix Firefox bug by toggling page class after inner transition finished.