PageSourceSearch

https://www.schaffrath.com/on/demandware.static/Sites-Schaffrath-S…/v1791424312086/js/appointmentButton.js

js schaffrath.com collected 2026-10-08 02:59:17 UTC 3,320 bytes, 75 lines download raw bytes

1/******/ (() => { // webpackBootstrap
2/******/ 	"use strict";
3var __webpack_exports__ = {};
4/*!**********************************************************************************************************!*\
5  !*** ./src/app_schaffrath/cartridges/app_page_designer/cartridge/client/default/js/appointmentButton.js ***!
6  \**********************************************************************************************************/
7
8
9$(document).ready(function () {
10  var iframeOrigin = $('.appointment-iframe').length ? new URL($('.appointment-iframe').attr('src')).origin : null;
11  $('body').on('click', '.appointment-btn', function (event) {
12    event.preventDefault();
13    var $this = $(this);
14    if ($this.hasClass('appointmentButton')) return;
15    var linkType = $this.data('linkType');
16    var url = $this.data('url');
17    var modal = $this.closest('.appointment-btn-container').find('.appointment-btn-modal');
18    var appointmentBtnsWrapper = $this.closest('.appointment-btns-wrapper ');
19    if (linkType === 'iframe') {
20      var body = $('body');
21      var iframeCloseMessage = $this.data('iframeCloseMessage');
22      var _closeIframe = function closeIframe(e) {
23        var iframeEvent = e.originalEvent;
24        if (iframeEvent.origin === iframeOrigin && iframeEvent.data === iframeCloseMessage && iframeEvent.source === modal.find('iframe')[0].contentWindow) {
25          modal.find('iframe').remove();
26          appointmentBtnsWrapper.removeClass('active');
27          modal.css('display', 'none');
28          body.css('overflow', '');
29          modal.append($('<iframe>', {
30            src: url,
31            width: '100%',
32            height: '100%',
33            css: {
34              overflow: 'hidden',
35              border: 'none'
36            }
37          }));
38          $(window).off('message', _closeIframe);
39        }
40      };
41      appointmentBtnsWrapper.addClass('active');
42      modal.css('display', 'block');
43      body.css('overflow', 'hidden');
44      $(window).on('message', _closeIframe);
45    } else if (linkType === 'external') {
46      window.open(url, '_blank');
47    } else {
48      $.ajax({
49        url: url,
50        type: 'GET'
51      });
52      appointmentBtnsWrapper.addClass('active');
53      modal.modal('toggle');
54      $('.modal-backdrop').appendTo($(this).closest('.appointment-btn-container'));
55      modal.on('hidden.bs.modal', function () {
56        appointmentBtnsWrapper.removeClass('active');
57      });
58      if ($this.hasClass('js-order-by-email')) {
59        $('#appointment-form').append('<input type="hidden" name="productId" value="' + $this.data('product-id') + '">');
60        $('#appointment-form').append('<input type="hidden" name="appointmentFormTopic" value="' + $this.data('case-topic') + '">');
61      }
62    }
63  });
64  document.documentElement.style.setProperty('--appointment-btns-bottom', $('.appointment-btns-wrapper').attr('bottom'));
65  var $wrapper = $('.appointment-btns-wrapper');
66  var footerEl = $('.footerMenu').closest('footer')[0] || $('.footerMenu')[0];
67  if ($wrapper.length && footerEl) {
68    $(window).on('scroll resize', function () {
69      $wrapper.toggleClass('is-footer-overlap', $wrapper[0].getBoundingClientRect().bottom > footerEl.getBoundingClientRect().top);
70    }).trigger('scroll');
71  }
72});
73/******/ })()
74;
75//# sourceMappingURL=appointmentButton.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.