PageSourceSearch

https://www.duodecim.fi/wp-content/themes/duodecim/assets/dist/js/…ts.bundle.a3d86bbdd47777c9074a.js?ver=7.1.2

js duodecim.fi collected 2026-10-02 06:13:58 UTC 4,718 bytes, 161 lines download raw bytes

1/******/ (() => { // webpackBootstrap
2(function($) {
3  "use strict";
4
5  $(function() {
6    // Variablet
7    var $duo_window = $(window),
8      $body = $("body"),
9      $wrapper = $("#wrapper"),
10      $search_btn = $(".search-button a"),
11      $main_header = $("#main-header"),
12      $burger = $("#menu-burger"),
13      $duo_parallax = $(".duo_parallax_bg"),
14      $parallax_section = $(".duo-section-parallax"),
15      $video_container = $(".embed-video-container"),
16      $title_hero = $(".duo-section-title"),
17      $submenu_switch = $(".open-submenu"),
18      $map_container = $(".duo-map-container"),
19      $prevScrollTop = 0;
20
21    // Pikahaun avaus
22    function quick_search() {
23      $search_btn.click(function(event) {
24        console.log("click search");
25        event.preventDefault();
26        $main_header.toggleClass("search-active");
27        $("#quick-search-input").focus();
28      });
29    }
30
31    // Mobiilivalikon avaus
32    function open_mobile_nav() {
33      $burger.click(function(event) {
34        event.preventDefault();
35        $main_header.toggleClass("menu-opened");
36        $body.toggleClass("menu-open");
37      });
38    }
39
40    // Mobiili valikon submenun avaus
41    function open_submenu() {
42      $submenu_switch.click(function(event) {
43        event.preventDefault();
44        var $submenu = $(this).next(".sub-menu");
45        $submenu.slideToggle(150);
46        $(this)
47          .parent()
48          .toggleClass("submenu-active");
49      });
50
51      // jos on current niin auki
52      var $current_parent_li = $(
53        "#menu-paavalikko > .current_page_item, #menu-paavalikko > .current_page_ancestor"
54      );
55
56      if ($current_parent_li.length) {
57        $current_parent_li.addClass("submenu-active");
58        $current_parent_li.find(".sub-menu").show();
59      }
60    }
61
62    // Parallax efecti
63    function apply_parallax() {
64      var element_top = $parallax_section.offset().top,
65        window_top = $duo_window.scrollTop(),
66        y_pos = (window_top + $duo_window.height() - element_top) * 0.3,
67        main_position;
68
69      main_position = "translate3d(0, " + y_pos + "px, 0px)";
70
71      $parallax_section.find(".duo_parallax_bg").css({
72        "-webkit-transform": main_position,
73        "-moz-transform": main_position,
74        "-ms-transform": main_position,
75        transform: main_position
76      });
77
78      var bg_height;
79
80      bg_height = $duo_window.height() * 0.3 + $parallax_section.innerHeight();
81
82      $duo_parallax.innerHeight(".duo_parallax_bg").css({ height: bg_height });
83    }
84    // Fixed desktop nav
85    function fixed_header() {
86      var $topNavHeight = $("#top-nav-wrapper").height();
87      var $scrollTop = $duo_window.scrollTop();
88      var $header = $("#wrapper");
89      //console.log($scrollTop, $topNavHeight, $prevScrollTop);
90
91      if ($scrollTop > $topNavHeight) {
92        $header.addClass("fixed-header");
93      } else {
94        $header.removeClass("fixed-header");
95      }
96
97      // To hide fixed header in mobile when scrolling down and revealing when scrolling up
98      if ($scrollTop > $prevScrollTop && $scrollTop > 152) {
99        $header.addClass("scroll-down");
100      } else {
101        $header.removeClass("scroll-down");
102      }
103      $prevScrollTop = $scrollTop;
104    }
105
106    // Funktiot käyntiin
107
108    $(document).ready(function() {
109      if ($main_header.length) {
110        $duo_window.scroll(fixed_header);
111        fixed_header();
112      }
113      if ($search_btn.length && !$(".search-results").length) {
114        quick_search();
115      }
116
117      if ($burger.length) {
118        open_mobile_nav();
119      }
120      // jquery.fitvids.js
121      if ($video_container.length) {
122        $video_container.fitVids();
123
124        $video_container.fitVids({
125          customSelector: "iframe[src^='http://socialcam.com']"
126        });
127      }
128      if ($submenu_switch.length) {
129        open_submenu();
130      }
131
132      $(window).load(function() {
133        var viewport = $(window).innerWidth();
134        var wH = $(window).height();
135        // Vain desktop
136        if (viewport > 1209) {
137          //
138          if ($duo_parallax.length) {
139            apply_parallax();
140            $duo_window.on("scroll", apply_parallax);
141          }
142        }
143        if (viewport < 990) {
144          // $('.hero-unit').css({ 'max-height' : wH +'px'});
145        }
146      });
147
148      /* Google maps juttu ota yhteyttä sivulla, tämä postettu käytöstä koska Gmaps policyt muttui
149      if ($map_container.length) {
150        $map_container.each(function() {
151          // create map
152          $map_container = new_map($(this)); // new_map() -> kts. duo-google-maps.js
153        });
154      }*/
155    });
156  });
157})(jQuery);
158
159/******/ })()
160;
161//# sourceMappingURL=duo-scripts.bundle.a3d86bbdd47777c9074a.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.