Function restrictPanByHandler