PageSourceSearch

https://ferienshop.davos.ch/assets/js/main.js?s=1790273416

js davos.ch collected 2026-09-24 18:11:02 UTC 6,223 bytes, 220 lines download raw bytes

1// Questi sono solo quelli sulla home, don't worry
2//CHECK-BOX "FILTER"
3$("[data-filter-checkbox-all]").on("click", function() {
4  if ($(this).is(":checked")) {
5    $("[data-filter-checkbox]").prop("checked", false);
6  }
7});
8
9$("[data-filter-checkbox]").on("click", function() {
10  if ($(this).is(":checked")) {
11    $("[data-filter-checkbox-all]").prop("checked", false);
12  }
13});
14
15let Helpers = {
16    lockScroll : (selector) => {
17        $(selector).addClass("scroll-locked");
18    },
19    unlockScroll : (selector) => {
20        $(selector).removeClass("scroll-locked");
21    },
22    addOverlayBackground : () => {
23        $("body").addClass("overlay-background");
24    },
25    removeOverlayBackground : () => {
26        $("body").removeClass("overlay-background");
27    }
28}
29
30//FILTER mobile -> open
31$(".container__filter-mobile").on("click", function(){
32  $(".container__filter-select").addClass("container__filter-select--visible");
33  Helpers.lockScroll("html, body");
34});
35
36//FILTER mobile -> close
37$(".container__close").on("click", function(){
38  $(".container__filter-select").removeClass("container__filter-select--visible");
39  Helpers.unlockScroll("html, body");
40});
41
42//Hotel-detail-lightbox -> open
43$('[data-hotel-detail-lightbox-open]').on("click", function(e) {
44  e.preventDefault();
45  e.stopPropagation();
46  $(".hotel-detail-lightbox").fadeIn();
47  $(".hotel-detail-lightbox").css('display' , 'flex');
48  Helpers.lockScroll("html, body");
49});
50
51//Hotel-detail-lightbox -> close
52$('[data-hotel-detail-lightbox-close]').on("click", function(e) {
53  e.preventDefault();
54  e.stopPropagation();
55  $(".hotel-detail-lightbox").fadeOut();
56  Helpers.unlockScroll("html, body");
57});
58
59//open filter hotel list
60$('[data-filter-open]').on("click", function(e){
61  e.stopPropagation();
62  $('.offcanvas-filter').css('transform','none');
63});
64
65//close filter hotel list
66$('[data-offcanvas-filter-close]').on("click", function(e) {
67  e.preventDefault();
68  e.stopPropagation();
69  $('.offcanvas-filter').css('transform','translateX(100%)');
70});
71
72$(".offcanvas-filter").on("click", function(e) {
73  e.stopPropagation();
74});
75
76$("body").on("click", function() {
77  $('.offcanvas-filter').css('transform','translateX(100%)');
78});
79
80//filter range price
81$(".js-range-slider").each(function(){
82  var $range = $(this);
83
84  $range.ionRangeSlider({
85     skin: "round",
86     type: "double",
87     prefix: "CHF ",
88     force_edges: true,
89     // step: 5
90      // min: $range.attr('min'),
91      // max: $range.attr('max'),
92      // from: $range.attr('from'),
93      // to: $range.attr('to'),
94   });
95});
96
97//CLICK TO SCROLL
98/*
99$(".container__scroll-down").click(function() {
100    $([document.documentElement, document.body]).animate({
101        scrollTop: $("#end-to-scoll").offset().top
102    }, 2000);
103});
104*/
105
106// SAMEHEIGHT service
107var tallest = 0;
108$('[data-events-height]').each(function(){
109  var height = $(this).innerHeight();
110  if (height > tallest){
111    tallest = height;
112  }
113});
114$('[data-events-height]').css('min-height',tallest);
115
116//DESCRIPTION DETAIL (SlideDown & SlideUp)
117$("[data-open-detail]").on("click", function() {
118  var target = $(this).attr("data-open-detail");
119  var $self = $(this);
120  if ($(this).hasClass("text--close")) {
121    var $target = $("[data-open-detail-target="+ target +"]");
122    $target.animate({
123      height: 200,
124    }, function(){
125         $self.removeClass("text--close");
126    })
127  } else {
128    var $target = $("[data-open-detail-target="+ target +"]");
129    var naturalHeight = $target.find(".text--description-detail").innerHeight();
130    $target.animate({
131      height: naturalHeight+20,
132    }, function(){
133         $self.addClass("text--close");
134    })
135  }
136});
137
138//FILTER show accordion
139$("[data-accordion-show]").on("click", function() {
140  var $accordionContent = $(this).parents("[data-accordion-parent]").find("[data-accordion-content]");
141  if ($accordionContent.is(":visible")) {
142    $accordionContent.slideUp();
143    $(this).removeClass("offcanvas-filter__accordion-bar--open");
144  } else {
145    $accordionContent.slideDown();
146    $(this).addClass("offcanvas-filter__accordion-bar--open");
147  }
148});
149
150//BUCHEN OPEN SELECT OFFCANVAS
151$("[data-guest-offcanvas-open]").on("click", function(e) {
152  e.stopPropagation();
153  $(".buchen__select-offcanvas").slideDown();
154});
155
156//BUCHEN CLOSE SELECT OFFCANVAS
157$("[data-guest-offcanvas-close]").on("click", function(e) {
158  e.stopPropagation();
159  $(".buchen__select-offcanvas").slideUp();
160});
161
162//BOOKING BAR
163$("[data-open-guest-open]").on("click", function(e) {
164  e.stopPropagation();
165  $(".guest-item--detail").slideDown();
166});
167$("[data-open-guest-close]").on("click", function(e) {
168  e.stopPropagation();
169  $(".guest-item--detail").slideUp();
170});
171$("body").on("click", function(e) {
172  // e.stopPropagation();
173  $(".guest-item--detail").slideUp();
174});
175
176
177$("[data-alert]").each(function(e) {
178  $(this).on("click", function(e) {
179    e.preventDefault();
180    window.currentAlert = new Alert(
181      $(this).attr("data-type"),
182      $(this).attr("data-title"),
183      $(this).attr("data-text"),
184      $(this).attr("data-icon"),
185      $(this).attr("data-yes"),
186      $(this).attr("data-no"),
187      function() {
188        console.log("YES CALLBACK");
189      },
190      function() {
191        console.log("NO CALLBACK");
192      }
193    );
194  });
195});
196
197$("[data-download-file]").on("click", function(e) {
198  console.log("test");
199  e.stopPropagation();
200});
201
202
203$("[data-accomodation-type]").on("change",  function() {
204
205  if ($("[data-accomodation-type] option:selected").text() == "Ferienwohnung") {
206      $("[data-accomodation-zimmer-container]").removeClass("d-none");
207      // $("[data-accomodation-zimmer]").prop('disabled', 'disabled');
208      // $("[data-accomodation-disabled]").addClass("field-custom--disabled");
209  }
210  else {
211    $("[data-accomodation-zimmer-container]").addClass("d-none");
212  //   $("[data-accomodation-zimmer-container]").removeClass("d-none");
213  //   $("[data-accomodation-zimmer-container]").removeClass("d-block");
214  //   // $("[data-accomodation-zimmer]").prop("disabled", false);
215  //   // $("[data-accomodation-disabled]").removeClass("field-custom--disabled");
216  }
217});
218
219 $("[data-accomodation-type]").trigger('change');
220//console.log($("[data-accomodation-type] option:selected").text());

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.