Is there a way to factorize that with the code from edge_swipe_detector.js ?