Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

hammer.js

Код файла
Версия от 18.08.2026, 07:00:16 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1901          } else if (input.eventType & INPUT_START) {1902              this.reset();1903              this._timer = setTimeoutContext(function() {1904                  this.state = STATE_RECOGNIZED;1905                  this.tryEmit();1906              }, options.time, this);1907          } else if (input.eventType & INPUT_END) {1908              return STATE_RECOGNIZED;1909          }1910          return STATE_FAILED;1911      },1912
История файла и сравнение версий
  • 18.08.2026, 07:00:16 · 56c3b845
1913 reset: function() {
1914 clearTimeout(this._timer);
1915 },
1916
1917 emit: function(input) {
1918 if (this.state !== STATE_RECOGNIZED) {
1919 return;
1920 }
1921
1922 if (input && (input.eventType & INPUT_END)) {
1923 this.manager.emit(this.options.event + 'up', input);
1924 } else {
1925 this._input.timeStamp = now();
1926 this.manager.emit(this.options.event, this._input);
1927 }
1928 }
1929 });
1930
1931 /**
1932 * Rotate
1933 * Recognized when two or more pointer are moving in a circular motion.
1934 * @constructor
1935 * @extends AttrRecognizer
1936 */
1937 function RotateRecognizer() {
1938 AttrRecognizer.apply(this, arguments);
1939 }
1940
1941 inherit(RotateRecognizer, AttrRecognizer, {
1942 /**
1943 * @namespace
1944 * @memberof RotateRecognizer
1945 */
1946 defaults: {
1947 event: 'rotate',
1948 threshold: 0,
1949 pointers: 2
1950 },
1951
1952 getTouchAction: function() {
1953 return [TOUCH_ACTION_NONE];
1954 },
1955
1956 attrTest: function(input) {
1957 return this._super.attrTest.call(this, input) &&
1958 (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
1959 }
1960 });
1961
1962 /**
1963 * Swipe
1964 * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
1965 * @constructor
1966 * @extends AttrRecognizer
1967 */
1968 function SwipeRecognizer() {
1969 AttrRecognizer.apply(this, arguments);
1970 }
1971
1972 inherit(SwipeRecognizer, AttrRecognizer, {
1973 /**
1974 * @namespace
1975 * @memberof SwipeRecognizer
1976 */
1977 defaults: {
1978 event: 'swipe',
1979 threshold: 10,
1980 velocity: 0.3,
1981 direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
1982 pointers: 1
1983 },
1984
1985 getTouchAction: function() {
1986 return PanRecognizer.prototype.getTouchAction.call(this);
1987 },
1988
1989 attrTest: function(input) {
1990 var direction = this.options.direction;
1991 var velocity;
1992
1993 if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
1994 velocity = input.overallVelocity;
1995 } else if (direction & DIRECTION_HORIZONTAL) {
1996 velocity = input.overallVelocityX;
1997 } else if (direction & DIRECTION_VERTICAL) {
1998 velocity = input.overallVelocityY;
1999 }
2000
Предыдущие 100 строкСледующие 100 строк