Prevent accidental page jump in class view