MCPcopy Create free account
hub / github.com/dcloudio/mui / getDirection

Function getDirection

js/mui.gestures.js:88–96  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

86 * @param {Object} y
87 */
88 var getDirection = function(x, y) {
89 if (x === y) {
90 return '';
91 }
92 if (abs(x) >= abs(y)) {
93 return x > 0 ? 'left' : 'right';
94 }
95 return y > 0 ? 'up' : 'down';
96 };
97 /**
98 * rotation
99 * @param {Object} start

Callers 2

calTouchDataFunction · 0.70
calIntervalTouchDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected