adds swipe code to detail and close pages