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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

hammer.js

Код файла
Версия от 18.08.2026, 07:00:16 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1401      this.options.enable = ifUndefined(this.options.enable, true);1402  1403      this.state = STATE_POSSIBLE;1404  1405      this.simultaneous = {};1406      this.requireFail = [];1407  }1408  1409  Recognizer.prototype = {1410      /**1411       * @virtual1412       * @type {Object}
История файла и сравнение версий
  • 18.08.2026, 07:00:16 · 56c3b845
1413
*/
1414 defaults: {},
1415
1416 /**
1417 * set options
1418 * @param {Object} options
1419 * @return {Recognizer}
1420 */
1421 set: function(options) {
1422 assign(this.options, options);
1423
1424 // also update the touchAction, in case something changed about the directions/enabled state
1425 this.manager && this.manager.touchAction.update();
1426 return this;
1427 },
1428
1429 /**
1430 * recognize simultaneous with an other recognizer.
1431 * @param {Recognizer} otherRecognizer
1432 * @returns {Recognizer} this
1433 */
1434 recognizeWith: function(otherRecognizer) {
1435 if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
1436 return this;
1437 }
1438
1439 var simultaneous = this.simultaneous;
1440 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1441 if (!simultaneous[otherRecognizer.id]) {
1442 simultaneous[otherRecognizer.id] = otherRecognizer;
1443 otherRecognizer.recognizeWith(this);
1444 }
1445 return this;
1446 },
1447
1448 /**
1449 * drop the simultaneous link. it doesnt remove the link on the other recognizer.
1450 * @param {Recognizer} otherRecognizer
1451 * @returns {Recognizer} this
1452 */
1453 dropRecognizeWith: function(otherRecognizer) {
1454 if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
1455 return this;
1456 }
1457
1458 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1459 delete this.simultaneous[otherRecognizer.id];
1460 return this;
1461 },
1462
1463 /**
1464 * recognizer can only run when an other is failing
1465 * @param {Recognizer} otherRecognizer
1466 * @returns {Recognizer} this
1467 */
1468 requireFailure: function(otherRecognizer) {
1469 if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
1470 return this;
1471 }
1472
1473 var requireFail = this.requireFail;
1474 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1475 if (inArray(requireFail, otherRecognizer) === -1) {
1476 requireFail.push(otherRecognizer);
1477 otherRecognizer.requireFailure(this);
1478 }
1479 return this;
1480 },
1481
1482 /**
1483 * drop the requireFailure link. it does not remove the link on the other recognizer.
1484 * @param {Recognizer} otherRecognizer
1485 * @returns {Recognizer} this
1486 */
1487 dropRequireFailure: function(otherRecognizer) {
1488 if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
1489 return this;
1490 }
1491
1492 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
1493 var index = inArray(this.requireFail, otherRecognizer);
1494 if (index > -1) {
1495 this.requireFail.splice(index, 1);
1496 }
1497 return this;
1498 },
1499
1500 /**
Предыдущие 100 строкСледующие 100 строк