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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-cart-1.1.js

Код файла
Версия от 04.12.2026, 04:03:54 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
6301		Element.prototype.matchesSelector ||6302		// @ts-expect-error ST-2949_16303		Element.prototype.msMatchesSelector ||6304		// @ts-expect-error ST-2949_16305		Element.prototype.mozMatchesSelector ||6306		Element.prototype.webkitMatchesSelector ||6307		// @ts-expect-error ST-2949_16308		Element.prototype.oMatchesSelector;6309}6310 6311/**6312 * Polyfill: Element.closest
История файла и сравнение версий
  • 04.12.2026, 04:03:54 · 56c3b845
6313 **/
6314if (!Element.prototype.closest) {
6315 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
6316 // @ts-expect-error ST-2949_2
6317 Element.prototype.closest = function (s) {
6318 var el = this;
6319 while (el && el.nodeType === 1) {
6320 if (Element.prototype.matches.call(el, s)) {
6321 return el;
6322 }
6323 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6324 // @ts-expect-error ST-2949_5
6325 el = el.parentElement || el.parentNode;
6326 }
6327 return null;
6328 };
6329}
6330
6331/**
6332 * It opens the cart window
6333 */
6334function tcart__openCartFullscreen() {
6335 if (document.body.classList.contains('t706__body_cartsidebarshowed')) {
6336 tcart__closeCartSidebar();
6337 }
6338
6339 if (location.href.indexOf('#tcart') !== -1) {
6340 window.history.replaceState({}, '', location.href.replace(/#tcart/g, ''));
6341 window.history.pushState({}, '', location.origin + location.pathname + '#tcart');
6342 } else {
6343 window.history.replaceState({}, '', location.origin + location.pathname + '#tcart');
6344 }
6345
6346 t_triggerEvent(document.body, 'popupShowed');
6347 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
6348 // @ts-expect-error ST-2949_3
6349 document.querySelector('body').classList.add('t706__body_cartpageshowed');
6350
6351 tcart__syncProductsObject__LStoObj();
6352 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6353 // @ts-expect-error ST-2949_5
6354 tcart__updateProductsPrice();
6355
6356 var cartWindow = document.querySelector('.t706__cartpage');
6357
6358 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
6359 // @ts-expect-error ST-2949_1
6360 cartWindow.style.display = '';
6361
6362 // create button that shows form on mobile
6363 if (window.tcart_isMobile) {
6364 var form = document.querySelector('.t706__cartpage-form');
6365 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
6366 // @ts-expect-error ST-2949_3
6367 var wrap = cartWindow.querySelector('.t706__cartpage-open-form-wrap');
6368 // @ts-expect-error ST-2949_3
6369 var btn = cartWindow.querySelector('.t706__cartpage-open-form');
6370
6371 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
6372 // @ts-expect-error ST-2949_1
6373 wrap.style.display = 'block';
6374 // @ts-expect-error ST-2949_1
6375 form.style.display = 'none';
6376
6377 // @ts-expect-error ST-2949_1
6378 if (btn.style.display === 'none') btn.style.display = 'block';
6379
6380 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
6381 // @ts-expect-error ST-2949_3
6382 btn.addEventListener('click', function () {
6383 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
6384 // @ts-expect-error ST-2949_1
6385 form.style.display = 'block';
6386 // @ts-expect-error ST-2949_1
6387 form.style.opacity = 0;
6388 // @ts-expect-error ST-2949_1
6389 form.style.transform = 'translateY(75%)';
6390 // @ts-expect-error ST-2949_1
6391 form.style.transition = 'opacity .1s, transform .1s';
6392
6393 setTimeout(function () {
6394 // @ts-expect-error ST-2949_1
6395 form.style.opacity = 1;
6396 // @ts-expect-error ST-2949_1
6397 form.style.transform = 'translateY(0)';
6398 }, 0);
6399
6400 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
Предыдущие 100 строкСледующие 100 строк