MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / check_direction_swipe

Function check_direction_swipe

codebase/sources/dhtmlxscheduler.es.js:7200–7227  ·  view source on GitHub ↗
(s_ev, e_ev, step, max_dy)

Source from the content-addressed store, hash-verified

7198 }, { passive: false });
7199 }
7200 function check_direction_swipe(s_ev, e_ev, step, max_dy) {
7201 if (!s_ev || !e_ev)
7202 return false;
7203 var t2 = s_ev.target;
7204 while (t2 && t2 != scheduler2._obj) {
7205 t2 = t2.parentNode;
7206 }
7207 if (t2 != scheduler2._obj) {
7208 return false;
7209 }
7210 if (scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]) {
7211 var timeline = scheduler2.matrix[scheduler2.getState().mode];
7212 if (timeline.scrollable) {
7213 return false;
7214 }
7215 }
7216 var dy = Math.abs(s_ev.pageY - e_ev.pageY);
7217 var dx = Math.abs(s_ev.pageX - e_ev.pageX);
7218 if (dy < max_dy && dx > step && (!dy || dx / dy > 3)) {
7219 if (s_ev.pageX > e_ev.pageX) {
7220 scheduler2._click.dhx_cal_next_button();
7221 } else {
7222 scheduler2._click.dhx_cal_prev_button();
7223 }
7224 return true;
7225 }
7226 return false;
7227 }
7228 function doMouseMove(e) {
7229 if (ignore(e))
7230 return;

Callers 1

extend$5Function · 0.70

Calls 1

getStateMethod · 0.65

Tested by

no test coverage detected