PageSourceSearch

https://teletorn.ee/wp-content/themes/teletorn/js/scripts.js?ver=1.7

js teletorn.ee collected 2026-09-24 23:16:23 UTC 3,388 bytes, 89 lines download raw bytes

1jQuery(document).ready(function($) {
2
3    // Make header sticky on scroll 
4    var header = $(".header-main");
5    var headerOffset = header.offset().top;
6
7    $(window).scroll(function() {
8        if ($(window).scrollTop() > headerOffset) {
9            header.addClass("sticky");
10            $(".header-menu").addClass("sticky"); // Corrected this line
11        } else {
12            header.removeClass("sticky");
13            $(".header-menu").removeClass("sticky"); // Corrected this line
14        }
15    });
16
17
18    // Menu toggle 
19    $('.header-menu-toggle').click(function() {
20        $('.header-menu').toggleClass('open');
21        $('body').toggleClass('no-scroll');
22    });
23    $('.header-menu-close').click(function() {
24        $('.header-menu').removeClass('open');
25        $('body').removeClass('no-scroll');
26    });
27    
28    $('.menu-wrap > ul.menu li.menu-item-has-children > a').click(function(e) {
29      e.preventDefault();
30      if ($(this).parent().hasClass('this-sub-menu-open')) {
31        if ($(this).parent().parent().hasClass('sub-menu-open')) {
32          $(this).parent().removeClass('this-sub-menu-open');
33          $('.menu-wrap > ul.menu').removeClass('sub-menu-open');
34        }
35        else {
36          $(this).parent().removeClass('this-sub-menu-open');
37          $(this).parent().parent().parent().addClass('this-sub-menu-open');
38          $(this).parent().parent().parent().removeClass('this-sub-menu-sub-menu-open');
39        }
40      }
41      else {
42        $(this).parent().parent().parent().addClass('this-sub-menu-sub-menu-open');
43        $(this).parent().parent().parent().removeClass('this-sub-menu-open');
44        $(this).parent().addClass('this-sub-menu-open');
45        $('.menu-wrap > ul.menu').addClass('sub-menu-open');
46      }
47    });
48
49    // Search toggle 
50    $('.header-search').click(function() {
51      $('.header-side-search').toggleClass('open');
52      $('body').toggleClass('no-scroll');
53    });
54    $('.header-side-search-close').click(function() {
55        $('.header-side-search').removeClass('open');
56        $('body').removeClass('no-scroll');
57    });
58    
59    $('html').click(function(event) {
60        if ($('.header-menu').hasClass('open') && $(event.target).closest('.header-menu-wrap').length === 0 && $(event.target).closest('.header-menu-toggle').length === 0) {
61            $('.header-menu').removeClass('open');
62            $('body').removeClass('no-scroll');
63        }
64        if ($('.header-side-search').hasClass('open') && $(event.target).closest('.header-side-search-wrap').length === 0 && $(event.target).closest('.header-search').length === 0) {
65            $('.header-side-search').removeClass('open');
66            $('body').removeClass('no-scroll');
67        }
68    });
69
70    // Footer columns 
71    if ($(window).width() < 650) {
72      $(".column-toggle").click(function(){
73          $(this).next(".footer-menu-wrap").slideToggle();
74          $(this).toggleClass('open');
75      });
76    }
77    
78    $(document).on('change, keyup', '.teletorn-search-form input.search-field', function() {
79      $('.teletorn-search-form .search-submit').show();
80    });
81    
82    $(".teletorn_add_to_calendar_button").click(function (e){
83        e.preventDefault();
84        $(this).parent().find('.teletorn_add_to_calendar_links').slideToggle();
85    });
86
87
88});
89

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.