/** * Swipe manager class. * * @author OMS Development Team * @author Dennis Eichhorn * @copyright 2013 Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @since 1.0.0 */ (function (jsOMS, undefined) { jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Touch'); /** * @constructor * * @since 1.0.0 * @author Dennis Eichhorn */ jsOMS.UI.Input.Touch.SwipeManager = function (app) { this.app = app; this.surface = {}; this.activeSwipe = {'startX': null, 'startY': null, 'time': null}; }; jsOMS.UI.Input.Touch.SwipeManager.prototype.add = function (surface, id, cUp, cRight, cDown, cLeft) { let e = document.getElementById(surface) self = this; e.addEventListener('touchstart', function(event) { let touch = e.changedTouches[0]; self.activeSwipe.startX = touch.pageX; self.activeSwipe.startY = touch.pageY; self.activeSwipe.time = new Date().getTime(); jsOMS.preventAll(event); }); }; }(window.jsOMS = window.jsOMS || {}));