vendor: 6,021 bytes, lines 1-11
1 2/*! SmoothScroll v16.1.4 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ 3!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).SmoothScroll=t()}(this,(function(){"use strict";window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;--t>=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(), 4/** 5 * requestAnimationFrame() polyfill 6 * By Erik Möller. Fixes from Paul Irish and Tino Zijdel. 7 * @link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 8 * @link http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 9 * @license MIT 10 */ 11function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,n){var o=(new Date).getTime(),i=Math.max(0,16-(o-e)),a=window.setTimeout((function(){t(o+i)}),i);return e=o+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}();var e={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,speedAsDuration:!1,durationMax:null,durationMin:null,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},t=function(){var e={};return Array.prototype.forEach.call(arguments,(function(t){for(var n in t){if(!t.hasOwnProperty(n))return;e[n]=t[n]}})),e},n=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,i=-1,a="",r=n.charCodeAt(0);++i<o;){if(0===(t=n.charCodeAt(i)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");t>=1&&t<=31||127==t||0===i&&t>=48&&t<=57||1===i&&t>=48&&t<=57&&45===r?a+="\\"+t.toString(16)+" ":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(i):"\\"+n.charAt(i)}return"#"+a},o=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},i=function(e){return e?(t=e,parseInt(window.getComputedStyle(t).height,10)+e.offsetTop):0;var t},a=function(e,t,n){0===e&&document.body.focus(),n||(e.focus(),document.activeElement!==e&&(e.setAttribute("tabindex","-1"),e.focus(),e.style.outline="none"),window.scrollTo(0,t))},r=function(e,t,n,o){if(t.emitEvents&&"function"==typeof window.CustomEvent){var i=new CustomEvent(e,{bubbles:!0,detail:{anchor:n,toggle:o}});document.dispatchEvent(i)}};return function(c,u){var s,l,d,m,f={};f.cancelScroll=function(e){cancelAnimationFrame(m),m=null,e||r("scrollCancel",s)},f.animateScroll=function(n,c,u){f.cancelScroll();var l=t(s||e,u||{}),w="[object Number]"===Object.prototype.toString.call(n),h=w||!n.tagName?null:n;if(w||h){var p=window.pageYOffset;l.header&&!d&&(d=document.querySelector(l.header));var g,y,v,S=i(d),E=w?n:function(e,t,n,i){var a=0;if(e.offsetParent)do{a+=e.offsetTop,e=e.offsetParent}while(e);return a=Math.max(a-t-n,0),i&&(a=Math.min(a,o()-window.innerHeight)),a}(h,S,parseInt("function"==typeof l.offset?l.offset(n,c):l.offset,10),l.clip),b=E-p,A=o(),O=0,C=function(e,t){var n=t.speedAsDuration?t.speed:Math.abs(e/1e3*t.speed);return t.durationMax&&n>t.durationMax?t.durationMax:t.durationMin&&n<t.durationMin?t.durationMin:parseInt(n,10)}(b,l),M=function(e){g||(g=e),O+=e-g,v=p+b*function(e,t){var n;return"easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t}(l,y=(y=0===C?0:O/C)>1?1:y),window.scrollTo(0,Math.floor(v)),function(e,t){var o=window.pageYOffset;if(e==t||o==t||(p<t&&window.innerHeight+o)>=A)return f.cancelScroll(!0),a(n,t,w),r("scrollStop",l,n,c),g=null,m=null,!0}(v,E)||(m=window.requestAnimationFrame(M),g=e)};0===window.pageYOffset&&window.scrollTo(0,0),function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id)}(n,w,l),"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches?a(n,Math.floor(E),!1):(r("scrollStart",l,n,c),f.cancelScroll(!0),window.requestAnimationFrame(M))}};var w=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(l=e.target.closest(c))&&"a"===l.tagName.toLowerCase()&&!e.target.closest(s.ignore)&&l.hostname===window.location.hostname&&l.pathname===window.location.pathname&&/#/.test(l.href)){var t,o;try{t=n(decodeURIComponent(l.hash))}catch(e){t=n(l.hash)}if("#"===t){if(!s.topOnEmptyHash)return;o=document.documentElement}else o=document.querySelector(t);(o=o||"#top"!==t?o:document.documentElement)&&(e.preventDefault(),function(e){if(history.replaceState&&e.updateURL&&!history.state){var t=window.location.hash;t=t||"",history.replaceState({smoothScroll:JSON.stringify(e),anch
11or:t||window.pageYOffset},document.title,t||window.location.href)}}(s),f.animateScroll(o,l))}},h=function(){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(s)){var e=history.state.anchor;"string"==typeof e&&e&&!(e=document.querySelector(n(history.state.anchor)))||f.animateScroll(e,null,{updateURL:!1})}};f.destroy=function(){s&&(document.removeEventListener("click",w,!1),window.removeEventListener("popstate",h,!1),f.cancelScroll(),s=null,l=null,d=null,m=null)};return function(){if(!("querySelector"in document&&"addEventListener"in window&&"requestAnimationFrame"in window&&"closest"in window.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";f.destroy(),s=t(e,u||{}),d=s.header?document.querySelector(s.header):null,document.addEventListener("click",w,!1),s.updateURL&&s.popstate&&window.addEventListener("popstate",h,!1)}(),f}})); 12 13// Generated by CoffeeScript 1.12.3 14 15/** 16@license Sticky-kit v1.1.4 | MIT | Leaf Corcoran 2015 | http://leafo.net 17 */ 18 19(function() { 20 var $, doc, win; 21 22 $ = window.jQuery; 23 24 win = $(window); 25 doc = $(document); 26 27 $.fn.stick_in_parent = function(opts) { 28 var doc_height, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, outer_width, parent_selector, recalc_every, ref, sticky_class, win_height; 29 if (opts == null) { 30 opts = {}; 31 } 32 sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming; 33 win_height = win.height(); 34 doc_height = doc.height(); 35 if (offset_top == null) { 36 offset_top = 0; 37 } 38 if (parent_selector == null) { 39 parent_selector = void 0; 40 } 41 if (inner_scrolling == null) { 42 inner_scrolling = true; 43 } 44 if (sticky_class == null) { 45 sticky_class = "is_stuck"; 46 } 47 if (enable_bottoming == null) { 48 enable_bottoming = true; 49 } 50 outer_width = function(el) { 51 var _el, computed, w; 52 if (window.getComputedStyle) { 53 _el = el[0]; 54 computed = window.getComputedStyle(el[0]); 55 w = parseFloat(computed.getPropertyValue("width")) + parseFloat(computed.getPropertyValue("margin-left")) + parseFloat(computed.getPropertyValue("margin-right")); 56 if (computed.getPropertyValue("box-sizing") !== "border-box") { 57 w += parseFloat(computed.getPropertyValue("border-left-width")) + parseFloat(computed.getPropertyValue("border-right-width")) + parseFloat(computed.getPropertyValue("padding-left")) + parseFloat(computed.getPropertyValue("padding-right")); 58 } 59 return w; 60 } else { 61 return el.outerWidth(true); 62 } 63 }; 64 ref = this; 65 fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) { 66 var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick; 67 if (elm.data("sticky_kit")) { 68 return; 69 } 70 elm.data("sticky_kit", true); 71 last_scroll_height = doc_height; 72 parent = elm.parent(); 73 if (parent_selector != null) { 74 parent = parent.closest(parent_selector); 75 } 76 if (!parent.length) { 77 throw "failed to find stick parent"; 78 } 79 fixed = false; 80 bottomed = false; 81 spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $("<div />"); 82 if (spacer) { 83 spacer.css('position', elm.css('position')); 84 } 85 recalc = function() { 86 var border_top, padding_top, restore; 87 if (detached) { 88 return; 89 } 90 win_height = win.height(); 91 doc_height = doc.height(); 92 last_scroll_height = doc_height; 93 border_top = parseInt(parent.css("border-top-width"), 10); 94 padding_top = parseInt(parent.css("padding-top"), 10); 95 padding_bottom = parseInt(parent.css("padding-bottom"), 10); 96 parent_top = parent.offset().top + border_top + padding_top; 97 parent_height = parent.height(); 98 if (fixed) { 99 fixed = false;
100 bottomed = false; 101 if (manual_spacer == null) { 102 elm.insertAfter(spacer); 103 spacer.detach(); 104 } 105 elm.css({ 106 position: "", 107 top: "", 108 width: "", 109 bottom: "" 110 }).removeClass(sticky_class); 111 restore = true; 112 } 113 top = elm.offset().top - (parseInt(elm.css("margin-top"), 10) || 0) - offset_top; 114 height = elm.outerHeight(true); 115 el_float = elm.css("float"); 116 if (spacer) { 117 spacer.css({ 118 width: outer_width(elm), 119 height: height, 120 display: elm.css("display"), 121 "vertical-align": elm.css("vertical-align"), 122 "float": el_float 123 }); 124 } 125 if (restore) { 126 return tick(); 127 } 128 }; 129 recalc(); 130 if (height === parent_height) { 131 return; 132 } 133 last_pos = void 0; 134 offset = offset_top; 135 recalc_counter = recalc_every; 136 tick = function() { 137 var css, delta, recalced, scroll, will_bottom; 138 if (detached) { 139 return; 140 } 141 recalced = false; 142 if (recalc_counter != null) { 143 recalc_counter -= 1; 144 if (recalc_counter <= 0) { 145 recalc_counter = recalc_every; 146 recalc(); 147 recalced = true; 148 } 149 } 150 if (!recalced && doc_height !== last_scroll_height) { 151 recalc(); 152 recalced = true; 153 } 154 scroll = win.scrollTop(); 155 if (last_pos != null) { 156 delta = scroll - last_pos; 157 } 158 last_pos = scroll; 159 if (fixed) { 160 if (enable_bottoming) { 161 will_bottom = scroll + height + offset > parent_height + parent_top; 162 if (bottomed && !will_bottom) { 163 bottomed = false; 164 elm.css({ 165 position: "fixed", 166 bottom: "", 167 top: offset 168 }).trigger("sticky_kit:unbottom"); 169 } 170 } 171 if (scroll < top) { 172 fixed = false; 173 offset = offset_top; 174 if (manual_spacer == null) { 175 if (el_float === "left" || el_float === "right") { 176 elm.insertAfter(spacer); 177 } 178 spacer.detach(); 179 } 180 css = { 181 position: "", 182 width: "", 183 top: "" 184 }; 185 elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick"); 186 } 187 if (inner_scrolling) { 188 if (height + offset_top > win_height) { 189 if (!bottomed) { 190 offset -= delta; 191 offset = Math.max(win_height - height, offset); 192 offset = Math.min(offset_top, offset); 193 if (fixed) { 194 elm.css({ 195 top: offset + "px" 196 }); 197 } 198 } 199 } 200 } 201 } else { 202 if (scroll > top) { 203 fixed = true; 204 css = { 205 position: "fixed", 206 top: offset 207 }; 208 css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px"; 209 elm.css(css).addClass(sticky_class); 210 if (manual_spacer == null) { 211 elm.after(spacer); 212 if (el_float === "left" || el_float === "right") { 213 spacer.append(elm); 214 } 215 } 216 elm.trigger("sticky_kit:stick"); 217 } 218 } 219 if (fixed && enable_bottoming) { 220 if (will_bottom == null) { 221 will_bottom = scroll + height + offset > parent_height + parent_top; 222 } 223 if (!bottomed && will_bottom) { 224 bottomed = true; 225 if (parent.css("position") === "static") { 226 parent.css({ 227 position: "relative" 228 }); 229 } 230 return elm.css({ 231 position: "absolute", 232 bottom: padding_bottom, 233 top: "auto" 234 }).trigger("sticky_kit:bottom"); 235 } 236 } 237 }; 238 recalc_and_tick = function() { 239 recalc(); 240 return tick(); 241 }; 242 detach = function() { 243 detached = true; 244 win.off("touchmove", tick); 245 win.off("scroll", tick); 246 win.off("resize", recalc_and_tick); 247 $(document.body).off("sticky_kit:recalc", recalc_and_tick); 248 elm.off("sticky_kit:detach", detach); 249 elm.removeData("sticky_kit"); 250 elm.css({ 251 position: "", 252 bottom: "", 253 top: "", 254 width: "" 255 }); 256 parent.position("position", ""); 257 if (fixed) { 258 if (manual_spacer == null) { 259 if (el_float === "left" || el_float === "right") { 260 elm.insertAfter(spacer); 261 } 262 spacer.remove(); 263 } 264 return elm.removeClass(sticky_class); 265 } 266 }; 267 win.on("touchmove", tick); 268 win.on("scroll", tick); 269 win.on("resize", recalc_and_tick); 270 $(document.body).on("sticky_kit:recalc", recalc_and_tick); 271 elm.on("sticky_kit:detach", detach); 272 return setTimeout(tick, 0); 273 }; 274 for (i = 0, len = ref.length; i < len; i++) { 275 elm = ref[i]; 276 fn($(elm)); 277 } 278 return this; 279 }; 280 281}).call(this); 282 283//global functions helpers for frontend 284if (!Element.prototype.matches) { 285 Element.prototype.matches = 286 Element.prototype.matchesSelector || 287 Element.prototype.mozMatchesSelector || 288 Element.prototype.msMatchesSelector || 289 Element.prototype.oMatchesSelector || 290 Element.prototype.webkitMatchesSelector || 291 function (s) { 292 var matches = (this.document || this.ownerDocument).querySelectorAll(s), 293 i = matches.length; 294 while (--i >= 0 && matches.item(i) !== this) { } 295 return i > -1; 296 }; 297} 298if (!String.prototype.endsWith) { 299 String.prototype.endsWith = function (search, this_len) { 300 if (this_len === undefined || this_len > this.length) { 301 this_len = this.length; 302 } 303 return this.substring(this_len - search.length, this_len) === search; 304 }; 305} 306 307 308 309(function ($) { 310 $.fn.isBrowserEdge = function () { 311 var $this = $(this); 312 return typeof CSS !== 'undefined' && CSS.supports("(-ms-ime-align:auto)"); 313 }; 314})(jQuery); 315 316function setDataUserAgent() { 317 var b = document.documentElement; 318 b.className = b.className.replace('no-js', 'js'); 319 b.setAttribute("data-useragent", navigator.userAgent); 320 b.setAttribute("data-platform", navigator.platform); 321} 322 323$.fn.isInViewport = function () { 324 var elementTop = $(this).offset().top; 325 var elementBottom = elementTop + $(this).outerHeight(); 326 var viewportTop = $(window).scrollTop(); 327 var viewportBottom = viewportTop + $(window).height(); 328 return elementBottom > viewportTop && elementTop < viewportBottom; 329}; 330 331//-- Verwijder alle klasses met bepaald voorvoegsel 332$.fn.removeClassLike = function (name) { 333 return this.removeClass(function (index, css) { 334 return (css.match(new RegExp('\\b(' + name + '\\S*)\\b', 'g')) || []).join(' '); 335 }); 336}; 337 338var IcordisFrontent = { 339 //--check hasScrollHorizontal 340 hasScrollHorizontal: function (elm) { 341 return Math.round(elm[0].scrollWidth) > Math.round(elm.outerWidth()); 342 }, 343 //--check hasScrollVertical 344 hasScrollVertical: function (elm) { 345 return elm[0].scrollHeight > Math.round(elm.outerHeight()); 346 }, 347 //Check overflow horizontal en vertical 348 hasOverflow: function (elm) { 349 return elm[0].scrollHeight > Math.round(elm.outerHeight()) || 350 elm[0].scrollWidth > Math.round(elm.outerWidth()); 351 } 352} 353function checkRow(container, items) { 354 var el = $(container), 355 rowCount = 0, 356 classPrefix = 'row-'; 357 358 $(window).on('load resize', function (e) { 359 var elItems = el.find(items); 360 //clear 361 el.removeClass('has-rows'); 362 elItems.removeClass('new-row end-row even odd').removeClassLike(classPrefix); 363 364 var rows = $.fn.matchHeight._rows(elItems); 365 // console.log(rows); 366 367 //clear 368 rowCount = 0; 369 370 if (rows.length > 1) { 371 el.addClass('has-rows'); 372 rows = $.fn.matchHeight._rows(elItems); 373 } else { 374 el.removeClass('has-rows'); 375 elItems.removeClassLike(classPrefix); 376 } 377 378 $.each(rows, function (i, row) { 379 rowCount++; 380 if (i % 2 === 0) { 381 /* we are even */ 382 row.addClass('odd'); 383 384 } else { 385 /* we are odd */ 386 row.addClass('even'); 387 } 388 row.addClass(classPrefix + rowCount); 389 row.first().addClass('new-row'); 390 row.last().addClass('end-row'); 391 }); 392 }); 393} 394 395//--Check floatcollapse 396function checkFloats(container, items, screenWidth) { 397 var $this = $(container), 398 currentRowStart = 0, 399 topPosition = 0, 400 currentItems = $this.find(items); 401 // console.log(currentItems.length); 402 403 if (screenWidth === undefined || screenWidth === null) { 404 screenWidth = gridFloatBreakpoint; //grid float breakpoints: 320, 544, //--480px, 768px, 992px, 1200px 405 } 406 if (currentItems.length >= 1) { 407 $('#inner-wrap, .navbar-default').removeClass('has-hamburger'); 408 409 currentItems.each(function (teller) { 410 currentElement = $(this); 411 topPostion = Math.ceil(currentElement.position().top); 412 // if ($(document).width() >= screenWidth) { 413 if (currentRowStart !== topPostion) { 414 $('#inner-wrap, .navbar-default').addClass('has-hamburger'); 415 } 416 // } 417 }); 418 } 419} 420 421//-- accessibility tabben enkel in modal open 422disableTabModalShown = function (el) { 423 var modal = el, 424 focusableChildren = modal.find('a[href], a[data-dismiss], area[href], input, select, textarea, button, iframe, object, embed, *[tabindex], *[contenteditable]').not(':hidden'),
425 numElements = focusableChildren.length, 426 currentIndex; 427 428 currentIndex = -1; 429 // $(document.activeElement).blur(); 430 // if (modal.hasClass('header-search')) { 431 // currentIndex = 1; 432 // } 433 // } else { 434 // $(document.activeElement).blur(); 435 // } 436 // if ( $('#search').hasClass('selected')) { 437 // currentIndex = focusableChildren[currentIndex]; 438 // } else { 439 // currentIndex = -1; 440 // } 441 // console.log(modal); 442 // console.log(focusableChildren,numElements); 443 444 var focus = function () { 445 var focusableElement = focusableChildren[currentIndex]; 446 if (focusableElement) 447 focusableElement.focus(); 448 }; 449 450 var focusPrevious = function () { 451 currentIndex--; 452 if (currentIndex < 0) 453 currentIndex = numElements - 1; 454 455 focus(); 456 return false; 457 }; 458 459 var focusNext = function () { 460 currentIndex++; 461 if (currentIndex >= numElements) 462 currentIndex = 0; 463 464 focus(); 465 return false; 466 }; 467 468 $(document).on('keydown', function (e) { 469 if (e.keyCode === 9 && e.shiftKey) { 470 e.preventDefault(); 471 focusPrevious(); 472 } 473 else if (e.keyCode === 9) { 474 e.preventDefault(); 475 focusNext(); 476 } 477 }); 478} 479 480//easing geplukt van jquery easing gebruikt voor de scrollto functie 481$.easing.elasout = function (x, t, b, c, d) { 482 var s = 1.70158; var p = 0; var a = c; 483 if (t === 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; 484 if (a < Math.abs(c)) { a = c; var s = p / 4; } 485 else var s = p / (2 * Math.PI) * Math.asin(c / a); 486 return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; 487}; 488 489//-- Functions 490//-- Check als het een nummer is 491function isNumeric(n) { 492 return !isNaN(parseFloat(n)) && isFinite(n); 493} 494 495 496//probeersel focus-within 497// function checkFocuswithin() { 498// var $focus = $('.check-focus-within'); 499// if ($focus.length > 0) { 500// $focus.find('a, button').focus(function() { 501// $(this).parents('.check-focus-within').removeClass('focus-within') 502// var className = $(this).attr('class').match(/\S*__link\b/i); 503// console.log(className); 504// if (!className) { 505// $(this).parents('.check-focus-within').addClass('focus-within'); 506// } else { 507// $(this).parents('.check-focus-within').removeClass('focus-within') 508// } 509// }); 510// } 511// } 512 513 514 515var Scroller = { 516 scrollers: null, 517 timer: null, 518 init: function () { 519 var that = this; 520 that.scrollers = $("[data-scroller]"); 521 if (that.scrollers.length > 0 && that.scrollers.children().length > 2) { 522 that.checkHorizontalScroll(); 523 $(window).on('resize', function (e) { 524 if (that.timer != null) { 525 clearTimeout(that.timer); 526 } 527 that.timer = setTimeout(function () { that.checkHorizontalScroll(); }, 300); 528 }); 529 $(document).on('click', 'button[data-scroll]', function (e) { 530 e.preventDefault(); 531 var btn = $(this); 532 that.goTo(btn); 533 }); 534 } 535 }, 536 checkHorizontalScroll: function () { 537 var that = this; 538 that.scrollers.each(function (i) { 539 var scrollZone = $(this), 540 elFade = scrollZone.parents('.' + that.scrollers.attr('data-scroller')); 541 542 // console.log(scrollZone, scrollZone.hasScrollHorizontal()); 543 544 if (IcordisFrontent.hasScrollHorizontal(scrollZone)) { 545 // console.log("hasscrollbar overflow"); 546 var scrollLeftPos = scrollZone.scrollLeft(); 547 548 if (scrollLeftPos > 0) { 549 elFade 550 .addClass('fade-left') 551 .find('.btn-scroll.prev') 552 .removeClass('hidden'); 553 } else { 554 elFade 555 .removeClass('fade-left') 556 .find('.btn-scroll.prev') 557 .addClass('hidden'); 558 } 559 560 if ( 561 scrollLeftPos + scrollZone.innerWidth() === 562 scrollZone[0].scrollWidth 563 ) { 564 elFade 565 .removeClass('fade-right') 566 .find('.btn-scroll.next') 567 .addClass('hidden'); 568 } else { 569 elFade 570 .addClass(' fade-right') 571 .find('.btn-scroll.next') 572 .removeClass('hidden'); 573 } 574 } else { 575 // console.log("NO scrollbar overflow"); 576 elFade.removeClass('fade-left fade-right').find('.btn-scroll').addClass('hidden'); 577 } 578 }); 579 }, 580 goTo: function (btn) { 581 var that = this; 582 var scrollzone = btn.parent().find('[data-scroller]'); 583 var currentScrollPos = scrollzone.scrollLeft(); 584 var width = scrollzone.innerWidth() / 2 ; 585 var scroll = btn.hasClass('prev') ? width : - width; 586 587 scrollzone.stop().animate({ 588 scrollLeft: currentScrollPos - scroll 589 }, { 590 duration: 250, 591 complete: function () { Scroller.checkHorizontalScroll(); } 592 }); 593 } 594} 595 596var Breadcrumb = { 597 breadcrumbs: null, 598 timer: null, 599 breadcrumbNavWith: 0, 600 breadcrumbLast: 0, 601 btnMore: null, 602 currentWidth: window.innerWidth, 603 eclipseOverflowWidth: 18, 604 lastItemText: null, 605 lastItemTextTrim: null, 606 607 init: function () { 608 var that = this; 609 that.breadcrumbs = $("[data-breadcrumb]"); 610 that.breadcrumbLast = Math.round(that.breadcrumbs.children().last(
610).width()) - Math.round(that.breadcrumbs.children().last().width() * .80); 611 // that.breadcrumbLast = Math.round(that.breadcrumbs.children().last().width()) - Math.round(that.breadcrumbs.children().last().width() * .75); 612 that.btnMore = $('.btn-showall'); 613 614 if (that.breadcrumbs.length > 0 && that.breadcrumbs.children().length > 2) { 615 if (that.timer != null) { 616 clearTimeout(that.timer); 617 } 618 that.initBreadcrumb(that.breadcrumbs); 619 that.checkBreadcrumbOverflow(); 620 that.timer = setTimeout(function () { 621 that.checkBreadcrumbOverflow(); 622 }, 500); 623 624 window.addEventListener('resize', () => { 625 if (window.innerWidth !== that.currentWidth) { 626 that.currentWidth = window.innerWidth; 627 if (that.timer != null) { 628 clearTimeout(that.timer); 629 } 630 that.timer = setTimeout(function () { that.checkBreadcrumbOverflow(); }, 500); 631 } 632 }); 633 634 that.btnMore.on('click',function(e){ 635 e.preventDefault(); 636 var btn = $(this); 637 btn.addClass('active hidden toggled').next().children().removeClass('hidden'); 638 that.breadcrumbs.removeAttr('style'); 639 that.breadcrumbs.children().removeClass('invisible'); 640 }); 641 } 642 }, 643 initBreadcrumb: function (el) { 644 var that = this; 645 var items = el.children('li'); 646 // calcBreadcrumbNavWidth 647 items.each(function () { 648 var breadcrumbNav = $(this); 649 breadcrumbNav.attr( 650 'data-width', 651 Math.ceil(breadcrumbNav.width()) 652 ); 653 654 that.breadcrumbNavWith += breadcrumbNav.data('width'); 655 }); 656 657 // var clone = el.parents('.breadcrumb__wrapper').clone().addClass('hide-breadcrumb'); 658 // el.parents('.breadcrumb').prepend(clone); 659 }, 660 661 checkBreadcrumbOverflow: function () { 662 var that = this; 663 if(!that.btnMore.hasClass('toggled')) { 664 that.breadcrumbs.each(function (i) { 665 // console.log(that.breadcrumbNavWith); 666 var breadcrumbWrapper = $(this), 667 overflowWidth = (Math.round(breadcrumbWrapper[0].scrollWidth) - Math.round(breadcrumbWrapper.outerWidth())), 668 move = 0, 669 t = 0, 670 tLast = breadcrumbWrapper.children().length - 1; 671 //clear 672 breadcrumbWrapper.removeAttr('style'); 673 breadcrumbWrapper.children().removeClass('invisible'); 674 // recalc 675 overflowWidth = (Math.round(breadcrumbWrapper[0].scrollWidth) - Math.round(breadcrumbWrapper.outerWidth())); 676 677 if ( overflowWidth > that.breadcrumbLast) { 678 $('.btn-showall').removeClass('hidden'); 679 breadcrumbWrapper.parents('.breadcrumb').addClass('has-more'); 680 681 breadcrumbWrapper.children().each(function () { 682 overflowWidth = (Math.round(breadcrumbWrapper[0].scrollWidth) - Math.round(breadcrumbWrapper.outerWidth())); 683 684 var breadcrumbNav = $(this); 685 var checkLeft = Math.round(breadcrumbNav.offset().left); 686 687 // console.log('leftpos: ' + checkLeft, 'overflow: ' + overflowWidth); 688 689 if (checkLeft < overflowWidth) { 690 // console.log(t, tLast); 691 if (t < tLast) { 692 breadcrumbNav.addClass('invisible'); 693 move += Math.round($(this).width()); 694 } 695 } else { 696 breadcrumbNav.removeClass('invisible'); 697 } 698 t ++; 699 }); 700 } 701 else { 702 breadcrumbWrapper.removeAttr('style'); 703 $('.btn-showall').addClass('hidden').removeClass('active'); 704 breadcrumbWrapper.parents('.breadcrumb').removeClass('has-more'); 705 } 706 707 // console.log('move: ' + move); 708 if (move == 0) { 709 breadcrumbWrapper.removeAttr('style'); 710 $('.btn-showall').addClass('hidden').removeClass('active'); 711 breadcrumbWrapper.parents('.breadcrumb').removeClass('has-more'); 712 } else { 713 breadcrumbWrapper.css({ 714 marginLeft: -(move) 715 }); 716 } 717 }); 718 } 719 }, 720 721 checkBreadcrumbInvisible: function () { }, 722 723 showAllBreadcrumbItems: function (btn) { 724 var btn = this; 725 }, 726 add3Dots(string, limit) 727 { 728 var dots = "..."; 729 if(string.length > limit) 730 { 731 // you can also use substr instead of substring 732 string = string.substring(0,limit) + dots; 733 } 734 return string; 735 }, 736} 737 738// Scroller.init(); 739$(function () { 740 Breadcrumb.init(); 741}); 742 743 744var Cookie = { 745 set: function (cookiename, noOfDays, value) { 746 747 var c_value = escape(value) + ";Path=/;samesite=lax;"; 748 749 if (noOfDays !== null) { 750 751 var exdate = new Date(); 752 exdate.setDate(exdate.getDate() + parseInt(noOfDays)); 753 c_value += " expires=" + exdate.toUTCString(); 754 } 755 if (window.location.protocol.indexOf('https') > -1) { 756 c_value += ";secure" 757 } 758 759 document.cookie = cookiename + "=" + c_value; 760 }, 761 get: function (cookiename) { 762 var name = cookiename + "="; 763 var decodedCookie = decodeURIComponent(document.cookie); 764 var ca = decodedCookie.split(';'); 765 for (var i = 0; i < ca.length; i++) { 766 var c = ca[i]; 767 while (c.charAt(0) === ' ') { 768 c = c.substring(1); 769 } 770 if (c.indexOf(name) === 0) { 771 return c.substring(name.length, c.length); 772 } 773 } 774 return ""; 775 }, 776 remove: function (cookiename) { 777 document.cookie = cookiename + "=;Path=/;SameSite=Lax;expires=Thu, 01 Jan 1970 00:00:01 GMT;"; 778 } 779}; 780let headings = document.querySelectorAll('.info h2[id^="anchor-"],.info h3[id^="anchor-"], h2.alphabet__letter'); 781 782let observer = new IntersectionObserver( 783 (entries) => { 784 const firstVisible = getFirstVisibleItem(); 785 if (firstVisible) { 786 $('[data-scrollto]').parent('.active').removeClass('active'); 787 if (firstVisible.id !== '') { 788 $('[data-scrollto][href="#' + firstVisible.id + '"]').parent().addClass('active'); 789 } else { 790 $('[data-scrollto][href="#' + firstVisible.closest('.alphabet__item').querySelector('.alphabet__keywords').id + '"]').parent().addClass('active'); 791 } 792 } 793 }, 794 { threshold: 1 } 795); 796
797headings.forEach((el) => { 798 observer.observe(el); 799}); 800 801 802function getFirstVisibleItem() { 803 const listItems = document.querySelectorAll('.info h2[id^="anchor-"],.info h3[id^="anchor-"], h2.alphabet__letter'); 804 805 for (let item of listItems) { 806 const rect = item.getBoundingClientRect(); 807 if (rect.top >= 0 && rect.bottom <= window.innerHeight) { 808 return item; // First fully visible item 809 } 810 } 811 812 return null; // No visible item found 813} 814//-- Check wanneer totop knop getoond mag worden 815function checkTopposition() { 816 var totop = $('#totop'); 817 818 if (!$('html.no-scroll').length > 0) { 819 checkScrollposition(totop); 820 } 821} 822 823//-- Functionaliteit wanneer totop knop getoond is 824function checkScrollposition(elShowhide) { 825 var elShowcheck = $('.brand').innerHeight(), 826 elFooter = $('#footer'); 827 footerCheck = $(document).height() - elFooter.innerHeight(), 828 totop = $('.toppos'); 829 830 if ($(this).scrollTop() > elShowcheck) { 831 elShowhide.fadeIn('fast'); 832 $('.scroll-down').addClass('hidden').hide(); 833 // icordisBtn.css({ 834 // 'top': '-100%' 835 // }); 836 } else { 837 elShowhide.fadeOut('fast'); 838 //icordisBtn.removeAttr('style'); 839 if ($('body.home').length > 0) { 840 $('.scroll-down').removeClass('hidden').show(); 841 } 842 } 843 844 if (Math.round($(window).scrollTop()) + $(window).height() > footerCheck) { 845 totop.addClass('animate'); 846 totop.css({ 847 bottom: Math.round($(window).scrollTop()) + $(window).height() - footerCheck + 15, // position boven de footer met spacing 848 // bottom: elFooter.innerHeight() + 30 / 2, // position boven de footer met spacing 849 }); 850 } else { 851 totop.removeAttr('style').removeClass('animate'); 852 } 853 854 // else { 855 // if ($(document).width() >= gridFloatBreakpoint) { 856 // totop.addClass('animate'); 857 858 // totop.removeAttr('style'); 859 // } 860 // } else { 861 // totop.removeAttr('style').removeClass('animate');; 862 // } 863}; 864 865 866 867//Hoogte van de banner berekenen 868function checkElVh(el, screenWidth) { 869 if (el === undefined || el === null) { 870 el = $('.header'); 871 } 872 if (screenWidth === undefined || screenWidth === null) { 873 screenWidth = gridFloatBreakpoint; //grid float breakpoints: 320, 544, //--480px, 768px, 992px, 1200px 874 } 875 876 if ($('body.home').length > 0) { 877 $(window).on("load resize", checkBannerheight); 878 } 879 880 function checkBannerheight() { 881 if ($(document).width() >= screenWidth) { 882 el.css({ 883 'minHeight': $(window).height() 884 }); 885 // $('.header-right').css({ 886 // 'top': ( $(window).height() - $('.header-right').innerHeight() ) / 2 887 // }) 888 889 } else { 890 el.removeAttr('style'); 891 // $('.header-right').removeAttr('style'); 892 } 893 } 894} 895 896 897function setOffcanvasHeaderOffset() { 898 var offcanvasHeaderOffset = 899 $('.header-main').offset().top + 900 $('.header-main').innerHeight() - 901 Math.ceil($(window).scrollTop()); 902 903 $('.header-nav-overlay, .header-nav').css({ 904 top: offcanvasHeaderOffset, 905 }); 906} 907var isFooterParallax = false; 908 909//-- Bij minder content footer onderaan de pagina houden 910// ! let op isFooterParallax true of false 911function footerFixedBottom(el) { 912 var elFooter = $('#footer'), 913 footerHeight = elFooter.outerHeight(), 914 windowHeight = $(window).height(), 915 filterMoved = false; 916 917 // $('#inner-wrap').css({ 918 919 if (!el) { 920 if ($('#inner-wrap').height() < windowHeight) { 921 $('#footer').css({ 922 'position': 'absolute', 923 'bottom': 0, 924 'width': '100%' 925 }); 926 927 if ($('div[data-filter="fixed"]').length > 0) { 928 var elf = $('div[data-filter="fixed"]'); 929 930 if (!filterMoved) { 931 var elReadytomove = elf.detach(); 932 $('<div/>', { 933 class: 'container', 934 html: elReadytomove 935 }).prependTo(elFooter); 936 } 937 filterMoved = true; 938 } 939 940 $('#inner-wrap').css({ 941 'minHeight': windowHeight, 942 'paddingBottom': footerHeight 943 }); 944 $('.toppos').css({ 945 'bottom': footerHeight + 30 946 }); 947 } else { 948 $('#footer, #inner-wrap').removeAttr('style'); 949 } 950 } else { 951 // console.log(windowHeight + "--" + footerHeight); 952 if (footerHeight < windowHeight) { 953 $('#footer').css({ 954 'position': 'fixed', 955 'bottom': 0, 956 'left': 0, 957 'width': '100%' 958 }); 959 $('#inner-wrap').css({ 960 'marginBottom': footerHeight 961 }); 962 } else { 963 $('#footer, #inner-wrap').removeAttr('style'); 964 } 965 } 966} 967 968var Menu = { 969 menuType: null, 970 metaType: null, 971 resizeTimer: null, 972 dropdownNavMenuWith: 0, 973 dropdownMetaMenuWith: 0, 974 countNavMenuWidth: 0, 975 navMain: null, 976 navMeta: null, 977 overlayActive: false, 978 hasMenuMore: false, 979 init: function () { 980 var that = this; 981 that.menuType = $('body').attr('data-menu'); 982 that.metaType = $('[data-dropdown]'); 983 that.navMain = $('.nav-main'); 984 if (that.menuType === 'dropdown') { 985 if (that.hasMenuMore) {
986 that.doMenuMore(); 987 } 988 that.calcMenuWidth(that.navMain); 989 that.doDropdown(); 990 that.checkDropDownSubMenuPosition(($('nav:not(.has-hamburger)'))); 991 that.doCheckDropdownOrHamburger(); 992 993 $(window).on('resize', function (e) { 994 Menu.dowindowResize(); 995 }); 996 } 997 998 if (that.metaType.length > 0) { 999 that.navMeta = $('.meta__list'); 1000 that.calcMetaWidth(that.navMeta); 1001 that.doMetaMore(); 1002 that.checkMetanav(); 1003 that.doDropdownToggle(); 1004 1005 $(window).on('resize', function (e) { 1006 if (that.timer != null) { 1007 clearTimeout(that.timer); 1008 } 1009 that.timer = setTimeout(function () { 1010 that.checkMetanav(); 1011 }, 20); 1012 }); 1013 } 1014 1015 1016 that.doHamburgerMenu(); 1017 that.checkActiveState(); 1018 }, 1019 1020 calcMenuWidth: function (el) { 1021 var that = this; 1022 var items = el.children('li'); 1023 items.each(function () { 1024 var li = $(this); 1025 li.attr( 1026 'data-width', 1027 Math.ceil( 1028 li.width() - 1029 (li.find('a').width() - li.find('span').width()) 1030 ) 1031 ); 1032 1033 that.dropdownNavMenuWith += li.data('width'); 1034 }); 1035 // console.log(that.dropdownNavMenuWith); 1036 }, 1037 1038 calcMetaWidth: function (el) { 1039 var that = this; 1040 var items = el.children('li'); 1041 // console.log(items); 1042 items.each(function () { 1043 var li = $(this); 1044 /* 1045 li.attr( 1046 'data-width', 1047 Math.ceil( 1048 li.width() - 1049 (li.find('a').width() - li.find('span').width()) 1050 ) 1051 ); 1052 */ 1053 li.attr( 1054 'data-width', 1055 Math.ceil( 1056 li.width() 1057 ) 1058 ); 1059 1060 that.dropdownMetaMenuWith += li.data('width'); 1061 }); 1062 // console.log(that.dropdownMetaMenuWith); 1063 }, 1064 1065 doMetaMore: function () { 1066 var that = this; 1067 var items = that.navMeta.children('li'); 1068 var elContainer = that.navMeta.parent(); 1069 // console.log('domenumore'); 1070 1071 var menuMetamore = $('<div/>') // creates a div element 1072 .addClass('dropdown dropdown-meta'); // add a class 1073 var menuMetamoreLink = $('<button/>', { 1074 // text: 'Meer', 1075 class: 'dropdown--toggle', 1076 }) 1077 .attr('toggle-dropdown', 'true') 1078 .html('<span>Meer</span><svg class="nav__icon more__icon" aria-hidden="true"><use href="/global/icons/global-line.svg#arrow-drop-down" style="fill:var(--icon-color-primary,var(--icon-color));transition:fill var(--transition-duration-base) var(--transition-timing-function)"></use></svg>') 1079 .appendTo(menuMetamore); 1080 1081 var menuMetamoreSub = $('<div/>').addClass('dropdown__menu'); 1082 1083 if (items.length > 0) { 1084 elContainer.prepend(menuMetamore); 1085 menuMetamoreSub.insertAfter(menuMetamoreLink); 1086 menuMetamoreSub.prepend(that.navMeta); 1087 // $('.dropdown-meta > .dropdown__menu').append(items); 1088 } 1089 }, 1090 1091 doMetaMoreReset: function () { 1092 var that = this; 1093 var elContainer = $('.meta__container-wrapper'); 1094 elContainer.prepend(that.navMeta); 1095 $('.dropdown-meta').remove(); 1096 }, 1097 1098 checkMetanav: function () { 1099 var that = this; 1100 var availablespace = $('.header__main div:first').width() + 20; //voor fullwidth nav 1101 //var availablespace = $('.header__container-wrapper').width() - $('.header__brand').outerWidth(true) - $('.header__search').width(); // nav in header-right 1102 1103 if (that.dropdownMetaMenuWith >= availablespace) { 1104 $('.header__meta').addClass('has-dropdown'); 1105 if (!$('.dropdown-meta').length > 0) { 1106 that.doMetaMore(); 1107 } 1108 } else { 1109 $('.header__meta').removeClass('has-dropdown');
1110 that.doMetaMoreReset(); 1111 } 1112 }, 1113 1114 doMenuMore: function () { 1115 var that = this; 1116 var t = 1; 1117 var count = 4; 1118 var items = that.navContainer.children('li'); 1119 // console.log('domenumore'); 1120 1121 var menuMainmore = $('<div/>') // creates a div element 1122 .addClass('nav-main nav-main--more dropdown'); // add a class 1123 var menuMainmoreLink = $('<a/>', { 1124 href: '#', 1125 class: 'nav__link btn-more', 1126 // tabindex: '-1', 1127 }).html('<span>Meer</span><svg class="nav__icon more__icon" aria-hidden="true"><use href="/global/icons/global-line.svg#arrow-drop-down" style="fill:var(--icon-color-primary,var(--icon-color));transition:fill var(--transition-duration-base) var(--transition-timing-function)"></use></svg>').appendTo(menuMainmore); 1128 1129 var menuMainmoreSub = $('<ul/>').addClass('dropdown__menu'); 1130 1131 items.each(function () { 1132 var li = $(this); 1133 if (t > 0 && t <= count) { 1134 li.attr( 1135 'data-width', 1136 Math.ceil( 1137 li.width() - 1138 (li.find('a').width() - li.find('span').width()) 1139 ) 1140 ); 1141 that.countNavMenuWidth += li.data('width'); 1142 // console.log('teller: ' + t + '= ' + that.countNavMenuWidth); 1143 } 1144 t++; 1145 }); 1146 1147 if (items.length > count) { 1148 menuMainmore.insertAfter($('.nav-main')); 1149 menuMainmoreSub.insertAfter(menuMainmoreLink); 1150 $('.nav-main--more > .dropdown__menu').append(items.slice(count)); 1151 } 1152 }, 1153 1154 doMenuMoreReset: function () { 1155 var items = $('.nav-main--more > .dropdown__menu').children('li'); 1156 $('ul.nav-main').append(items); 1157 $('.nav-main--more').remove(); 1158 }, 1159 1160 doCheckDropdownOrHamburger: function () { 1161 var that = this; 1162 // if ($('.header__compact').length == 0) {m 1163 // availablespace = $('.header__main div:first').width(); //voor fullwidth nav 1164 // } else { 1165 // availablespace = $('.header__container-wrapper').width() - $('.header__brand').outerWidth(true); 1166 // } 1167 1168 1169 const widthMainMenu = $('.header__container-wrapper').width(); 1170 const availablespace = $('.brand').outerWidth(true) + $('.header__search').width() + $('.header__combined-menu').width() + 40; 1171 1172 if (widthMainMenu < availablespace) { 1173 $('.navigation-main, .header').addClass('has-hamburger'); 1174 $('.navigation__container-wrapper').addClass('container'); 1175 if (that.hasMenuMore) { 1176 that.doMenuMoreReset(); 1177 } 1178 } else { 1179 $('.navigation-main, .header').removeClass('has-hamburger'); 1180 $('.navigation__container-wrapper').removeClass('container'); 1181 if (that.hasMenuMore) { 1182 if (!$('.nav-main--more').length > 0) { 1183 that.doMenuMore(); 1184 } 1185 } 1186 } 1187 }, 1188 1189 doDropdown: function () { 1190 var that = this; 1191 $(document) 1192 .on('mouseenter', 'nav:not(.has-hamburger) li.dropdown', function () { 1193 var li = $(this); 1194 li.addClass('open'); 1195 1196 var a = li.find('a'); 1197 a.attr('aria-expanded', 'true'); 1198 }) 1199 .on('mouseleave', 'nav:not(.has-hamburger) li.dropdown', function () { 1200 var li = $(this); 1201 li.removeClass('open'); 1202 1203 var a = li.find('a'); 1204 a.attr('aria-expanded', 'false'); 1205 }); 1206 }, 1207 1208 doDropdownToggle: function () { 1209 var that = this; 1210 $(document) 1211 .on('click', '[toggle-dropdown]', function () { 1212 var btn = $(this); 1213 btn.toggleClass('active').parent().toggleClass('open toggle--open'); 1214 var open = btn.hasClass('active'); 1215 btn.attr('aria-expanded', open ? 'true' : 'false'); 1216 Menu.checkDropDownSubMenuPosition($('.dropdown-meta')); 1217 }); 1218 var btn = $('[toggle-dropdown]'); 1219 if (btn.length > 0) { 1220 $(document).on('click', function (e) { 1221 1222 if (btn.hasClass('active')) { 1223 1224 if (btn.has(e.target).length === 0) { 1225 1226 btn.attr('aria-expanded', 'false'); 1227 btn.removeClass('active'); 1228 btn.parent().removeClass('open toggle--open'); 1229 } 1230 } 1231 }); 1232 } 1233 }, 1234 1235 checkDropDownSubMenuPosition: function (dropdownEl) { 1236 var windowWidth = $(window).width(); 1237 var dropdownItems = dropdownEl.find('.dropdown__menu'); 1238 dropdownItems 1239 .removeClass('dropdown__menu--left') 1240 .removeClass('dropdown__menu--right') 1241 .removeClass('dropdown__menu--center'); 1242 dropdownItems.each(function (e) { 1243 var dropdownMenu = $(this); 1244 var parentPosition = dropdownMenu.parent().offset().left; 1245 var dropDownMenuWidth = parentPosition + dropdownMenu.outerWidth(); 1246 if (dropDownMenuWidth > windowWidth) { 1247 dropdownMenu.addClass( 1248 dropDownMenuWidth - dropdownMenu.outerWidth() < 0 1249 ? 'dropdown__menu--center' 1250 : 'dropdown__menu--right' 1251 ); 1252 } else { 1253 dropdownMenu.addClass('dropdown__menu--right'); 1254 } 1255 }); 1256 }, 1257 1258 doHamburgerMenu: function () { 1259 var that = this; 1260 1261 var positionElement = $('[data-menu-position]'); 1262 1263 $(window).on('resize', function (e) { 1264 Menu.setHamburgerMenuPosition(positionElement); 1265 Menu.setOffcanvasMaxHeight(positionElement); 1266 1267 }); 1268 1269 $(document).on('click', '[data-toggle="offcanvas"]', function () { 1270 that.setHamburgerMenuPosition(positionElement); 1271 var toggleMenu = $('[data-toggle="offcanvas"].btn-toggle-menu'); 1272 1273 //active class op body wanneer menu openstaat. 1274 //$('body').toggleClass('active'); 1275 1276 if (that.overlayActive === false) { 1277 that.overlayActive = true; 1278 toggleMenu 1279 .attr('aria-expanded', 'true') 1280 .addClass('is-active'); 1281 1282 $('.header__nav') 1283 .addClass('is-active') 1284 .attr('tabindex', -1) 1285 .trigger('focus'); 1286 1287 $('html').addClass('no-scroll'); 1288 1289 if ($('[data-readspeaker]') && that.navMain != null) { 1290 $('[data-readspeaker]').find($('.header-readspeaker').insertAfter(that.navMain)); 1291 } 1292 that.setOffcanvasMaxHeight(positionElement); 1293 disableTabModalShown($('.header__nav')); 1294 } else { 1295 that.overlayActive = false;
1296 toggleMenu 1297 .attr('aria-expanded', 'false') 1298 .removeClass('is-active'); 1299 1300 $('.header__nav') 1301 .removeClass('is-active') 1302 .delay(100) 1303 .queue(function () { 1304 $(this).removeAttr('tabindex').dequeue(); 1305 toggleMenu.css('pointer-events', ''); 1306 $('.nav__container-wrapper').removeAttr('style'); 1307 }); 1308 1309 if ($('[data-readspeaker]')) { 1310 if ($('body.home').length > 0) { 1311 $('[data-readspeaker]').find($('.header-readspeaker').insertAfter($('.header-main'))); 1312 } else { 1313 $('[data-readspeaker]').find($('.header-readspeaker').insertAfter($('.page-heading'))); 1314 } 1315 } 1316 1317 $('html').removeClass('no-scroll'); 1318 $(document).off('keydown'); 1319 } 1320 }); 1321 }, 1322 1323 setHamburgerMenuPosition: function (positionElement) { 1324 if (positionElement.length > 0) { 1325 var pos = positionElement.attr('data-menu-position'); 1326 if (pos === 'under') { 1327 var root = document.documentElement; 1328 if (!$('.is_stuck').length > 0) { 1329 var positionTop = 1330 positionElement.offset().top - 1331 window.scrollY + 1332 positionElement.outerHeight(true); 1333 } else { 1334 var positionTop = $('.is_stuck').height(); 1335 } 1336 document 1337 // .getElementsByTagName('header')[0] 1338 .querySelectorAll('header.header')[0] 1339 .style.setProperty( 1340 '--overlay-top-position', 1341 positionTop + 'px' 1342 ); 1343 } 1344 } 1345 }, 1346 1347 dowindowResize: function () { 1348 var that = this; 1349 if (that.currentWidth !== $(window).width()) { 1350 that.currentWidth = $(window).width(); 1351 if (that.resizeTimer != null) { 1352 clearTimeout(that.resizeTimer); 1353 } 1354 that.resizeTimer = setTimeout(function () { 1355 Menu.doCheckDropdownOrHamburger(); 1356 Menu.checkDropDownSubMenuPosition(($('nav:not(.has-hamburger)'))); 1357 // Menu.setMenuPosition(); 1358 }, 20); 1359 } 1360 }, 1361 1362 checkActiveState: function () { 1363 var that = this; 1364 if ($('.navigation-main li.active').length == 0) { 1365 var nav = $('.navigation-main'); 1366 $( 1367 '.breadcrumb__container-wrapper.main > ol.nav-breadcrumb > li > a' 1368 ).each(function () { 1369 var el = $(this); 1370 var url = el 1371 .attr('href') 1372 .replace( 1373 window.location.protocol + 1374 '//' + 1375 window.location.hostname, 1376 '' 1377 ) 1378 .toLowerCase(); 1379 1380 var m = nav.find('a[href="' + url + '"]'); 1381 // console.log(url,m); 1382 if (m.length > 0) { 1383 m.parent().addClass('active'); 1384 } 1385 }); 1386 if (that.navMain != null) { 1387 var m = that.navMain.find( 1388 'a[href="' + window.location.pathname.toLowerCase() + '"]' 1389 ); 1390 if (m.length > 0) { 1391 m.parent().addClass('active'); 1392 m.attr('aria-current', 'page'); 1393 } 1394 } 1395 } 1396 }, 1397 1398 setOffcanvasMaxHeight: function (positionElement) { 1399 var that = this; 1400 var menu = that.navMain; 1401 if (menu != null && positionElement.length > 0) { 1402 var pos = positionElement.attr('data-menu-position'); 1403 if (pos === 'under') { 1404 var ncw = $('.nav__container-wrapper'); 1405 if (ncw.length > 0) { 1406 var navWrapperTop = 1407 $(window).height() - 1408 Math.round(ncw.offset().top) + 1409 window.scrollY; 1410 $('.nav__container-wrapper').css({ 1411 maxHeight: navWrapperTop, 1412 }); 1413 1414 if (IcordisFrontent.hasScrollVertical(ncw)) { 1415 // console.log('has-scroll') 1416 // console.log(menu); 1417 menu.parents('.container').addClass('has-overflow-vertical'); 1418 } else { 1419 menu.parents('.container').removeClass('has-overflow-vertical'); 1420 // console.log('no-scroll') 1421 } 1422 } 1423 } 1424 } 1425 } 1426}; 1427 1428$(function () { 1429 Menu.init(); 1430}); 1431 1432//-- needed html for suggestionsearch ==> <ul id="suggestionsearch" class="list" style="display:none"></ul> 1433var searchCounter = 0; 1434var searchKeyPressTimer = null; 1435function suggestionsearch(c) { 1436 var keyword = $('#lcp-searchbox-keyword').val(); 1437 var searchtype = ''; 1438 var allwords = keyword.split(' '); 1439 var lastsearchterm = allwords[allwords.length - 1]; 1440 if (keyword.length > 2 && lastsearchterm.length > 2) { 1441 var lang = $('html').attr('lang').split('-')[0]; 1442 if (lang === 'nl') { lang = ''; } else { 1443 lang = '/' + lang; 1444 } 1445 $("#lcp-searchbox-keyword").addClass("is-loading"); 1446 $('#lcp-suggestion-search').hide().addClass('invisibility'); 1447 $('#search').removeClass('selected').parents('.header__search').removeClass('focus-within'); 1448 keyword = encodeURI(keyword); 1449 var dataPost = { q: keyword }; 1450 $.ajax({ 1451 async: true, 1452 data: dataPost, 1453 url: lang + '/zoeken/suggestie' 1454 }).done(function (partialView) { 1455 var scrollSearchselected = $('[data-scrolltop-suggestionsearch="True"]').length > 0; 1456 if (scrollSearchselected) { 1457 var searchTopPosition = $('[data-scrolltop-suggestionsearch="True"]').offset().top - 30; 1458 } 1459 if (c === searchCounter) { 1460 $("#lcp-suggestion-search").html(partialView); 1461 // if (isOverlay) { 1462 if (partialView !== '') { 1463 if ($("#lcp-searchbox-keyword").is(":focus")) { 1464 $("#lcp-suggestion-search").show().removeClass('hide').removeClass('invisibility'); 1465 } 1466 $('#search') 1467 .addClass('selected') 1468 .parents('.header__search') 1469 .addClass('focus-within'); 1470 if (scrollSearchselected) { 1471 // console.log('toppos: ' + searchTopPosition); 1472 $('html,body').scrollTop(searchTopPosition); 1473 } 1474 } else { 1475 $("#lcp-suggestion-search").hide().addClass('hide').addClass('invisibility'); 1476 $('#search') 1477 .removeClass('selected') 1478 .parents('.header__search') 1479 .removeClass('focus-within'); 1480 } 1481 // disableTabModalShown($('.header-search')); 1482 // } 1483 1484 $("#lcp-searchbox-keyword").removeClass("is-loading"); 1485 } 1486 }); 1487 } else { 1488 $('#lcp-suggestion-search').hide().addClass('hide').addClass('invisibility'); 1489 $('#search') 1490 .removeClass('selected') 1491 .parents('.header__search') 1492 .removeClass('focus-within'); 1493 $("#lcp-searchbox-keyword").removeClass("is-loading"); 1494 } 1495}; 1496function HideSearchSuggestions(e) { 1497 if ($(e.target).closest("#search").length == 0 && !$('#lcp-suggestion-search').hasClass('hide')) { 1498 $('#lcp-suggestion-search').hide().addClass('hide').addClass('invisibility'); 1499 $('#search') 1500 .removeClass('selected') 1501 .parents('.header__search') 1502 .removeClass('focus-within'); 1503 } 1504} 1505//-- Bindings voor suggestionsearch 1506function BindSearch() { 1507 $(document).on('click', function (e) { 1508 HideSearchSuggestions(e); 1509 }).on('keyup', function (e) { 1510 if (e.which == 9) { 1511 HideSearchSuggestions(e); 1512 } 1513 }); 1514 1515 $('#lcp-searchbox-keyword').on('keypress', function (e) { 1516 if (e.which === 13) { e.preventDefault(); $('#lcp-searchbox-btn').trigger('click'); } 1517 }) 1518 .on('keyup',function (e) { 1519 if (e.which !== 38 && e.which !== 40 && e.which !== 13 && e.which !== 32) { 1520 1521 1522 searchCounter++; 1523 if (searchKeyPressTimer !== null) { 1524 clearTimeout(searchKeyPressTimer); 1525 } 1526 1527 searchKeyPressTimer = setTimeout(function () { suggestionsearch(searchCounter); }, 150); 1528 1529 1530 } else if (e.which == 40) { 1531 $('.search-suggestion__list .search-suggestion__item:first a').trigger('focus'); 1532 } 1533 }); 1534 //} 1535 $('#lcp-searchbox-keyword').on('focus', function () { 1536 $('.search__group').addClass('focus'); 1537 if ($('.header__nav').hasClass('is-active')) { 1538 offcanvasClose($('[data-toggle="offcanvas"]')); 1539 } 1540 }).on('blur',function () { 1541 $('.search__group') 1542 .removeClass('focus') 1543 }); 1544 1545} 1546 1547$("#lcp-searchbox-keyword").on('keydown', function (e) { 1548 var keyCode = e.keyCode || e.which; 1549 if (keyCode === 9) { 1550 if (e.shiftKey) { 1551 $('#lcp-suggestion-search').hide().addClass('hide').addClass('invisibility'); 1552 } 1553 } 1554}); 1555 1556$(document).on('keydown', '#lcp-suggestion-search .search__suggestion-btn', function (e) { 1557 var keyCode = e.keyCode || e.which; 1558 if (keyCode === 9) { 1559 if (!e.shiftKey) { 1560 $('#lcp-suggestion-search').hide().addClass('hide').addClass('invisibility'); 1561 setTimeout(function () { $('#lcp-searchbox-btn').trigger('focus'); }, 1); 1562 } 1563 } 1564}); 1565 1566//-- Unbindings voor suggestionsearch 1567function UnBindSearch() { 1568 $("#search").off(); 1569 $('#lcp-searchbox-keyword').off(); 1570 $('#lcp-suggestion-search').hide().addClass('hide').addClass('invisibility'); 1571} 1572 1573BindSearch(); 1574 1575//-- Classes toevoegen bij headersearch 1576function initSearchOverlay(el) { 1577 var headerSearch = $(el), 1578 elSearchfield = $(el).find('input.txt'); 1579 1580 elSearchfield.on('keyup', function () { 1581 if ($(this).val().length > 1) { 1582 if (!headerSearch.hasClass('is-active')) { 1583 $('[data-toggle="searchbtn"]').addClass('is-active') 1584 .attr('aria-expanded', 'true').show(); 1585 1586 headerSearch.addClass('is-active'); 1587 disableTabModalShown(headerSearch); 1588 1589 $('html').addClass('no-scroll'); 1590 $('.scroll-down').hide(); 1591 isOverlay = true; 1592 } 1593 } 1594 }); 1595} 1596 1597$('[data-toggle="searchbtn"]').on('click', function () { 1598 var elSearchbtn = $('[data-toggle="searchbtn"]'), 1599 headerSearch = $('.header-search'); 1600 elSearchbtn.toggleClass('is-active'); 1601 headerSearch.toggleClass('is-active'); 1602 if (elSearchbtn.hasClass('is-active')) { 1603 elSearchbtn.attr('aria-expanded', 'true').show(); 1604 disableTabModalShown(headerSearch); 1605 $('html').addClass('no-scroll'); 1606 $('.scroll-down').hide(); 1607 isOverlay = true; 1608 } else { 1609 $('#lcp-suggestion-search').hide().addClass('hide').addClass('invisibility'); 1610 elSearchbtn.attr('aria-expanded', 'false').blur().hide(); 1611 $('html').removeClass('no-scroll'); 1612 $(document).off('keydown'); 1613 $('.scroll-down').removeAttr('style'); 1614 $("#lcp-searchbox-keyword").val('').removeClass("is-loading"); 1615 isOverlay = false;
1616 } 1617}); 1618 1619//-- Set Placeholder text on input field / text area field 1620function initPlaceholder() { 1621 setSearchPlaceholder(); 1622 // $('input[data-toggle-placeholder="1"],textarea[data-toggle-placeholder="1"]').focus(function () { 1623 // $(this).attr('placeholder', ''); 1624 // }).blur(function () { 1625 // $(this).attr('placeholder', $(this).attr('title')); 1626 // }); 1627} 1628 1629//-- Placeholder tekst veranderen naar andere tekst bij kleinere schermen 1630function setSearchPlaceholder(screenWidthMax) { 1631 if (screenWidthMax === undefined || screenWidthMax === null) { 1632 screenWidthMax = gridFloatBreakpointMax; //grid float breakpoints: 480px, 768px, 992px, 1200px 1633 } 1634 var txt = $('#lcp-searchbox-keyword'); 1635 if ($('#lcp-search-form').length > 0) { 1636 if ($(document).width() <= screenWidthMax) { 1637 txt.attr('placeholder', txt.attr('data-placeholder-mobile')); 1638 } else { 1639 txt.attr('placeholder', txt.attr('title')); 1640 } 1641 } 1642} 1643 1644$(document).ready(function () { 1645 // Search.init(); 1646 initPlaceholder(); 1647}).on( 1648 'keydown', 1649 '#lcp-suggestion-search > .search-suggestion__list > .search-suggestion__item a', 1650 function (e) { 1651 if (e.which === 40 || e.which === 38) { 1652 e.stopPropagation(); 1653 e.preventDefault(); 1654 1655 var li = $(this).parent(); 1656 var items = $( 1657 '#lcp-suggestion-search > .search-suggestion__list > .search-suggestion__item' 1658 ); 1659 var index = items.index(li); 1660 1661 if (e.which === 40) { 1662 index += 1; 1663 } else if (e.which === 38) { 1664 index -= 1; 1665 } 1666 1667 if (index < 0) { 1668 $('#lcp-searchbox-keyword').trigger('focus'); 1669 } else if (index < items.length) { 1670 $( 1671 '#lcp-suggestion-search > .search-suggestion__list > .search-suggestion__item:eq(' + 1672 index + 1673 ') a' 1674 ).trigger('focus'); 1675 } else { 1676 $('.search__suggestion-btn').trigger('focus'); 1677 // $('.list-suggestionsearch li:eq(0) a').focus(); 1678 } 1679 } 1680 } 1681).on('click', '[data-toggle="offsearch_open"]', function (e) { 1682 var btn = $(this); 1683 btn.addClass('active'); 1684 1685 $('.header__search').addClass('active').find('input.txt').trigger('focus').addClass('focus'); 1686 $('.main').addClass('active'); 1687 $('html').addClass('no-scroll'); 1688 1689 if (btn.attr('aria-expanded') == "true") { 1690 btn.attr('aria-expanded', false); 1691 } 1692 else if (btn.attr('aria-expanded') == "false") { 1693 btn.attr('aria-expanded', true); 1694 } 1695}) 1696 .on('click', '[data-toggle="offsearch_close"]', function (e) { 1697 $('.header__search').removeClass('active').find('input.txt').trigger('blur').removeClass('focus'); 1698 $('.searchbtn').removeClass('active'); 1699 $('.main').removeClass('active'); 1700 $('html').removeClass('no-scroll'); 1701 }) 1702 .on('click', '[data-toggle="searchbtn"]', function (e) { 1703 $('.header__search').removeClass('active').find('input.txt').trigger('blur').removeClass('focus'); 1704 $('.searchbtn').removeClass('active'); 1705 $('.main').removeClass('active'); 1706 $('html').removeClass('no-scroll'); 1707 }); 1708 1709var Search = { 1710 init: function() { 1711 var that = this; 1712 that.searchType = $('body').attr('data-search'); 1713 if (that.searchType === 'search-home-on-banner' && $('body.home.has-headerbanner').length > 0) { 1714 that.bindEventsSearchboxCheck(); 1715 that.checkSearchBoxPosition(); 1716 } 1717 }, 1718 1719 bindEventsSearchboxCheck: function() { 1720 var that = this; 1721 window.addEventListener('resize', that.checkSearchBoxPosition); 1722 }, 1723 1724 checkSearchBoxPosition: function() { 1725 const headerSearch = document.querySelector('.header__search'); 1726 const bannerPhoto = document.querySelector('.header__media-photo'); 1727 const searchGroup = document.querySelector('.search__group'); 1728 const bannerPhotoRect = bannerPhoto.getBoundingClientRect(); 1729 const bannerPhotoHeight = bannerPhotoRect.height; 1730 const searchRect = searchGroup.getBoundingClientRect(); 1731 const searchHeight = searchRect.height; 1732 1733 // do something with the element height 1734 const topPosition = Math.round((bannerPhotoHeight/2) - (searchHeight/2)); 1735 1736 //do the magic you want 1737 if (window.innerWidth <= gridFloatBreakpoint) { 1738 headerSearch.removeAttribute('style'); 1739 headerSearch.classList.remove('in-header'); 1740 } else { 1741 headerSearch.classList.add('in-header'); 1742 headerSearch.style.setProperty('--position-search', `${topPosition}px`); 1743 } 1744 }, 1745} 1746 1747var Ajaxify = { 1748 ajaxContainer: null, 1749 keyTimer: null, 1750 timer: null, 1751 refreshTime: 60000, 1752 lang: '', 1753 init: function () { 1754 var that = this; 1755 1756 var lang = $('html').attr('lang').split('-')[0]; 1757 lang = lang === 'nl' ? '' : ('/' + lang); 1758 that.lang = lang; 1759 1760 that.ajaxContainer = $('#ajax-container'); 1761 if (that.ajaxContainer.length > 0) { 1762 $('[data-hide-for-ajax="1"]').addClass('hidden'); 1763 $(document).ready(function () { 1764 $(this).on('change', 'input[data-do-viewmode],select[data-do-ajax="1"]', function (e) { 1765 e.stopPropagation(); 1766 e.stopImmediatePropagation(); 1767 e.preventDefault(); 1768 var rbtn = $(this); 1769 Cookie.set(rbtn.attr('data-do-viewmode'), 30, rbtn.val()); 1770 that.doRequest(rbtn); 1771 }).on('change', 'input[data-do-qry]', function (e) { 1772 e.stopPropagation(); 1773 e.stopImmediatePropagation(); 1774 e.preventDefault(); 1775 var rbtn = $(this); 1776 $('.side-bar form input[name="' + rbtn.attr('data-do-qry') + '"]').val(rbtn.val()); 1777 that.doRequest(rbtn); 1778 }) 1779 .on('change', 'input[data-do-ajax="1"]', function (e) { 1780 e.stopPropagation(); 1781 e.stopImmediatePropagation(); 1782 e.preventDefault(); 1783 var chk = $(this); 1784 1785 var form = chk.closest('form'); 1786 if (form.attr('id') === 'activefilterform') { 1787 1788 $('input[type="checkbox"][name="' + chk.attr('name') + '"][value="' + chk.attr('value') + '"]').prop('checked', false); 1789 $('input[type="hidden"][name="' + chk.attr('name') + '"],input[type="text"][name="' + chk.attr('name') + '"]').val(''); 1790 } 1791 that.doRequest(chk); 1792 1793 }).on('click', '[data-hide-for-ajax="1"]', function (e) { 1794 e.preventDefault(); 1795 that.doRequest($(this)); 1796 }).on('click', 'button[data-do-ajax="1"][data-to][data-from]', function (e) { 1797 e.preventDefault(); 1798 var btn = $(this); 1799 $('#to').val(btn.attr('data-to')); 1800 $('#from').val(btn.attr('data-from')); 1801 that.doRequest(btn); 1802 }).on('keyup', 'input[type="text"][data-do-ajax-blur="1"]', function (e) { 1803 if (that.keyTimer !== null) { 1804 clearTimeout(that.keyTimer); 1805 } 1806 var input = $(this); 1807 1808 if (e.keyCode !== 13) { 1809 1810 that.keyTimer = setTimeout(function () { that.doRequest(input); }, 350); 1811 } else { 1812 e.preventDefault(); 1813 that.doRequest(input); 1814 } 1815 1816 }); 1817 1818 that.checkActiveFilters(); 1819 }).on('click', 'button[data-remove-filter]', function (e) { 1820 e.preventDefault(); 1821 var id = $(this).attr('data-remove-filter'); 1822 var item = $('#' + id); 1823 if (item.attr('type') === 'text' || item.attr('type') === 'date') { 1824 item.val(''); 1825 } else if (item[0].localName === 'select') { 1826 item.val(''); 1827 item.find("option:selected").prop("selected", false) 1828 } else { 1829 var isChecked = item.prop('checked'); 1830 item.prop('checked', !isChecked); 1831 } 1832 1833 that.doRequest(item); 1834 }) 1835 } 1836 1837 if ($('button[data-load-more-ajax-url]').length > 0) { 1838 $(document).on('click', 'button[data-load-more-ajax-url]', function (e) { 1839 e.preventDefault(); 1840 var btn = $(this); 1841 that.loadMoreAjax(btn); 1842 }); 1843 } 1844 that.checkAZVisible(); 1845 setTimeout(function () { that.refreshContactStatus(); }, that.refreshTime); 1846 1847 },
1848 loadMoreAjax: function (btn) { 1849 var ajaxContainer = $('#' + btn.attr('data-target')); 1850 var url = btn.attr('data-load-more-ajax-url') + "&offset=" + ajaxContainer.find('article').length; 1851 var noOfRecords = parseInt(btn.attr('data-total-records')); 1852 $.ajax({ 1853 async: true, 1854 type: 'GET', 1855 url: url 1856 }).done(function (partialview) { 1857 1858 ajaxContainer.append(partialview); 1859 1860 if (noOfRecords === ajaxContainer.find('li,article').length) { 1861 btn.addClass('hidden'); 1862 } 1863 }); 1864 }, 1865 doRequest: function (input) { 1866 1867 var that = this; 1868 that.setLoadingScreen(); 1869 var url = window.location.pathname; 1870 var form = input.closest('form'); 1871 1872 if (form.length === 0) { form = $('.side-bar form,.top-bar form') }; 1873 1874 var arr; 1875 if (form.length === 0) { 1876 arr = [{ name: input.attr('name'), value: input.val() }]; 1877 } else { 1878 arr = form.serializeArray(); 1879 } 1880 1881 var q = ''; 1882 1883 for (var i = 0; i < arr.length; i++) { 1884 var p = arr[i]; 1885 if (p.value !== null && p.value !== '' && !p.name.endsWith('_submit') && p.value !== 'on') { 1886 if (q !== '') { q += '&'; } 1887 q += p.name + '=' + encodeURIComponent( p.value); 1888 } 1889 } 1890 if (q !== '') { url += '?' + q; } 1891 window.history.replaceState(null, null, url); 1892 1893 url += (url.indexOf('?') === -1 ? '?' : '&') + 'ajax=1'; 1894 1895 $.ajax({ 1896 async: true, 1897 type: 'GET', 1898 url: url 1899 }).done(function (partialview) { 1900 clearTimeout(that.timer); 1901 1902 that.ajaxContainer.html(partialview); 1903 that.ajaxContainer.removeAttr('style'); 1904 that.updateAZ(); 1905 that.checkActiveFilters(); 1906 that.setTotalItems(); 1907 var datael = document.querySelector('[data-mh]'); 1908 if (datael !== null) { 1909 // $('.list > li').matchHeight(); 1910 $(datael).matchHeight({ remove: true }); 1911 $.fn.matchHeight._maintainScroll = true; 1912 $.fn.matchHeight._applyDataApi(); 1913 //console.log("ajaxify update"); 1914 } 1915 1916 if (typeof Website !== "undefined" && typeof Website.Streetmap !== "undefined" && $('.streetmap').length > 0) { 1917 if (!$('.streetmap').hasClass('leaflet-container')) { 1918 Website.Streetmap.reset(); 1919 } 1920 1921 1922 } 1923 1924 if (typeof (Website) !== "undefined" && typeof (Website.MyInterests) !== "undefined") { 1925 Website.MyInterests.bindButtons(); 1926 } 1927 1928 stickify('.alertbox-filter', 0, '.page-container', gridFloatBreakpoint); 1929 footerFixedBottom(); 1930 }).fail(function () { 1931 that.ajaxContainer.html('<class="alertbox-error">error</div>'); 1932 }); 1933 1934 that.reloadFacet(form, arr, input); 1935 1936 }, 1937 setTotalItems: function () { 1938 var totalText = $('#total-items-data'); 1939 if (totalText.length > 0) { 1940 let split = totalText.html().split(' '); 1941 const newText = `<span>(</span>${split[0]}<span>)</span><span class="sr-only">${split[1]} ${split[2]} </span>` 1942 1943 $('#total-items').html(newText); 1944 } 1945 }, 1946 reloadFacet: function (form, arr, input) { 1947 var that = this; 1948 // update facet navigation 1949 var facets = $('.facet-navigation:not([data-facet="' + input.attr('data-facet') + '"]'); 1950 if (facets.length > 0) { 1951 1952 var q = ''; 1953 for (var i = 0; i < arr.length; i++) { 1954 var p = arr[i]; 1955 if (p.value !== null && p.value !== '' && !p.name.endsWith('_submit') && p.value !== 'on') { 1956 q += '&' + p.name + '=' + p.value; 1957 } 1958 } 1959 1960 1961 facets.each(function () { 1962 var fieldset = $(this); 1963 1964 var facetkey = fieldset.attr('data-facet'); 1965 1966 $.ajax({ 1967 async: true, 1968 type: 'GET', 1969 url: fieldset.attr('data-facet-ajax-url') + '?fieldname=' + facetkey + q 1970 }).done(function (json) { 1971 for (var i = 0; i < json.length; i++) { 1972 var item = json[i]; 1973 var hasItems = item.noOfItems > 0; 1974 var chk = $('.facet-search-item[data-facet="' + facetkey + '"][value="' + item.value + '"]'); 1975 chk.prop('disabled', !hasItems); 1976 var li = chk.parent(); 1977 if (hasItems) { 1978 li.removeClass('is-readonly'); 1979 } else { 1980 li.addClass('is-readonly'); 1981 } 1982 li.find(' span .search-count').html(item.noOfItems); 1983 } 1984 }); 1985 1986 }); 1987 1988 } 1989 },
1990 setLoadingScreen: function () { 1991 var that = this; 1992 that.ajaxContainer.height(that.ajaxContainer.height() + 'px'); 1993 that.ajaxContainer.html('<div aria-hidden="true" class="loading"><svg class="loading__icon" data-icon="search-loading" aria-hidden="true"><use href="/global/icons/global-loaders.svg#search-loading" style="fill: var(--icon-color-primary, var(--icon-color)); transition:fill var(--transition-duration-base) var(--transition-timing-function);"></use></svg></div>'); 1994 }, 1995 updateAZ: function () { 1996 var that = this; 1997 var az = $('.nav-az'); 1998 if (az.length > 0) { 1999 2000 var li = []; 2001 $('.alphabet-item .keywords').each(function () { 2002 var l = this.id; 2003 li.push('<li><a rel="nofollow" href="#' + l + '" data-scrollto="az">' + l.substring(2) + '</a></li>'); 2004 }); 2005 az.html(li.join('')); 2006 } else { 2007 2008 } 2009 2010 that.checkAZVisible(); 2011 }, 2012 checkAZVisible: function () { 2013 if ($('.alphabet__item').length > 0) { 2014 $('#az-filter').removeClass('hidden'); 2015 } else { 2016 $('#az-filter').addClass('hidden'); 2017 } 2018 }, 2019 refreshContactStatus: function () { 2020 var that = this; 2021 var div = $('[data-refresh-open-status] '); 2022 2023 div.each(function () { 2024 var div = $(this); 2025 2026 2027 var hourID = div.data('refresh-open-status'); 2028 $.ajax({ 2029 async: true, 2030 type: 'GET', 2031 data: { hourID: hourID }, 2032 url: that.lang + '/contact/status' 2033 }).done(function (json) { 2034 2035 div.attr('class', 'contact__hours-status-box ' + json.cssclass).html('<span>' + json.statusText + '</span>'); 2036 2037 $('[data-today-hourid="' + hourID + '"] .txt-hours').html(json.hoursToday); 2038 $('[data-tomorrow-hourid="' + hourID + '"] .txt-hours').html(json.hoursTomorrow); 2039 }); 2040 2041 }); 2042 2043 setTimeout(function () { that.refreshContactStatus(); }, that.refreshTime); 2044 }, 2045 checkActiveFilters: function () { 2046 var templateTag = $('#header-filter-template'); 2047 if (templateTag.length > 0) { 2048 2049 var items = $('input[data-do-ajax="1"]:checked:not([name="SorteerType"],[name="sort"],input[name="viewmode"]),input[type="text"],input[type="date"],select[data-do-ajax="1"] option:selected'); 2050 2051 var div = $('.header-filters'); 2052 var ul = div.find('.list-filter'); 2053 var hasItems = false; 2054 if (items !== undefined && items.length > 0) { 2055 div.removeClass('hidden'); 2056 var html = ''; 2057 var noOfFilters = 0; 2058 var template = templateTag.html(); 2059 2060 items.each(function () { 2061 var i = $(this); 2062 var title = ''; 2063 var id = ''; 2064 if (i.parent().hasClass('ddl-group')) { 2065 2066 id = i.parent().attr('id'); 2067 if (i.parent().val() !== '') { 2068 2069 title = i.text(); 2070 } 2071 } 2072 else if (i.val() !== '') { 2073 id = i.attr('id'); 2074 title = $('label[for="' + i.attr('id') + '"] > span').text(); 2075 if (i.attr('type') === 'date') { 2076 var date = Date.parse(i.val()); 2077 title = Intl.DateTimeFormat().format(date); 2078 } else if (i.attr('type') === 'text') { 2079 title = i.val(); 2080 } 2081 } 2082 2083 if (title !== '') { 2084 2085 html += template.replace('{id}', id).replace("{title}", title); 2086 hasItems = true; 2087 noOfFilters++; 2088 } 2089 }); 2090 if (noOfFilters > 1) { 2091 html += $('#header-filter-template-delete-all').html(); 2092 } 2093 2094 ul.html(html); 2095 } 2096 2097 if (!hasItems) { 2098 div.addClass('hidden'); 2099 ul.html(''); 2100 } 2101 } 2102 } 2103}; 2104 2105Ajaxify.init(); 2106 2107 2108//-- Stickify functionality toevoeging met combinatie van de plugin js\sticky-kit 2109function stickify(el, posSpacing, parent, screenWidth, elPosition) { 2110 var container = $(el); 2111 2112 if (posSpacing === undefined || posSpacing === null) { 2113 posSpacing = 0; 2114 } 2115 2116 if (parent === undefined || parent === null) { 2117 parent = container.parent(); 2118 } 2119 2120 if (screenWidth === undefined || screenWidth === null) { 2121 screenWidth = gridFloatBreakpoint; //grid float breakpoints: 480px, 768px, 992px, 1200px 2122 } 2123
2124 if (elPosition === undefined || elPosition === null) { 2125 elPosition = 'top'; 2126 } 2127 2128 checkStickyposition(elPosition); 2129 2130 $(window).on('resize',function () { 2131 checkStickyposition(elPosition); 2132 }); 2133 2134 function checkStickyposition(el) { 2135 if (el === 'top') { 2136 if ($(document).width() >= screenWidth) { 2137 if (!container.siblings('.box-filter').length) { 2138 container 2139 .stick_in_parent({ 2140 offset_top: posSpacing, 2141 parent: parent, 2142 recalc_every: 1 2143 }) 2144 .on('sticky_kit:stick', function(e) { 2145 if ($('.box-anchor-links').length > 0) { 2146 var el = container.find('.box__block'), 2147 scroll = $(window).scrollTop(); 2148 el.css({ 2149 maxHeight: 2150 $(window).height() - 2151 ($(el).offset().top - scroll) - 2152 posSpacing, 2153 overflowY: 'auto' //eventueel in commentaar als je styled @pieter 2154 }); 2155 } 2156 }); 2157 // .on('sticky_kit:bottom ', function(e) { 2158 // console.log('bottom!', e.target); 2159 // }); 2160 } 2161 } else { 2162 container.trigger("sticky_kit:detach"); 2163 } 2164 } else { 2165 // container.on("sticky_kit:unstick ", function() { 2166 // } 2167 } 2168 }; 2169} 2170 2171 2172/**************** 2173* sticky header * 2174****************/ 2175function stickyheader() { 2176 var elHeader = $('.header'),
2177 headerStickspacer = $('<div/>') // creates a div element 2178 .attr('id', 'header-stick-spacer') // adds the id 2179 .addClass('header-stick-spacer'); // add a class 2180 checkHeaderposition(); 2181 $(window).on('resize scroll', checkHeaderposition); 2182 2183 function checkHeaderposition() { 2184 if ($('.widget-vlw-placeholder').length > 0 || $('.vlw').length > 0) { 2185 var stickyOffset = 43; 2186 } else { 2187 var stickyOffset = 0; 2188 } 2189 2190 var headerOffset = Math.round(elHeader.offset().top - stickyOffset), 2191 headerCheck = elHeader.innerHeight(), 2192 scrollPos = Math.round($(window).scrollTop()); 2193 2194 2195 // console.log(scrollPos, headerCheck, headerTop); 2196 // console.log(headerTop, scrollPos); 2197 2198 if (scrollPos > 0 && scrollPos >= headerOffset) { 2199 elHeader 2200 .css({ 2201 position: 'fixed', 2202 top: stickyOffset, 2203 left: 0, 2204 width: '100%', 2205 }) 2206 .addClass('is_stuck'); 2207 $('.search-top').addClass('in-header'); 2208 if (!$('#header-stick-spacer').length > 0) { 2209 headerStickspacer.insertAfter(elHeader).css({ 2210 height: headerCheck, 2211 }); 2212 } else { 2213 $('#header-stick-spacer').css({ 2214 height: headerCheck, 2215 }); 2216 } 2217 } else { 2218 unstickHeader(); 2219 } 2220 2221 if ($('#header-stick-spacer').length > 0) { 2222 var headerStickyspacer = $('#header-stick-spacer').offset().top; 2223 if (scrollPos <= headerStickyspacer) { 2224 unstickHeader(); 2225 } 2226 // console.log('is sticky: ' + headerStickyspacer, scrollPos); 2227 } 2228 } 2229 2230 function unstickHeader() { 2231 elHeader.removeAttr('style').removeClass('is_stuck'); 2232 $('#header-stick-spacer').remove(); 2233 $('.search-top').removeClass('in-header'); 2234 } 2235} 2236 2237var icordis = icordis || {}; 2238icordis.Tabs = { 2239 init: function () { 2240 var that = this; 2241 2242 $('#tablist a').on('click',function (e) { 2243 e.preventDefault(); 2244 var el = $(this); 2245 var id = el.attr('id'); 2246 var tabPosition = id.indexOf('algemeen') == -1 ? '?tab=' + id : ''; 2247 if (window.location.href.toLowerCase().indexOf('/aanpassen') == -1) { 2248 window.history.replaceState(null, null, window.location.pathname + tabPosition); 2249 } 2250 $('#tablist a').attr('aria-selected', 'false').attr('tabindex', -1).parent().removeClass('active'); 2251 el.attr('aria-selected', 'true').attr('tabindex', 0).parent().addClass('active'); 2252 2253 $('.tab-item').addClass('hidden'); 2254 $('#' + el.attr('aria-controls')).removeClass('hidden'); 2255 2256 $('#current-active-tab').val(id); 2257 2258 if (el.html().toLowerCase().indexOf('stratenplan') > -1 && typeof (Icordis.StreetmapControl) !== "undefined" && Icordis.StreetmapControl.map !== null) { 2259 Icordis.StreetmapControl.updateMap(); 2260 } 2261 }); 2262 2263 if (window.location.hash.indexOf('tabs-')>-1) { 2264 var hash = window.location.hash; 2265 window.addEventListener('load', function () { 2266 setTimeout(function () { 2267 $('a[href="' + hash + '"]').trigger('click'); 2268 }, 0); 2269 }); 2270 } else if (window.location.search.indexOf('tab') > -1) { 2271 var searchParams = new URLSearchParams(window.location.search); 2272 // console.log($('a[href="' + searchParams.get('tab') + '"]')); 2273 var tabId = searchParams.get('tab'); 2274 window.addEventListener('load', function () { 2275 setTimeout(function () { 2276 $('#' + tabId).trigger('click'); 2277 }, 0); 2278 }); 2279 } 2280 } 2281 2282 2283} 2284icordis.Tabs.init(); 2285 2286 2287//-- Tab toegankelijkheid voor de share mogelijkheid 2288function boxShareAccessible(el) { 2289 var elBtn = $(el), 2290 isClicked = false; 2291 2292 2293 elBtn.on('click',function () { 2294 var $this = $(this); 2295 expandSharebox($this); 2296 }); 2297 2298 function expandSharebox(el) { 2299 el.parent().toggleClass('is-active'); 2300 if (!isClicked) { 2301 el.attr('aria-expanded', 'true') 2302 .next().removeClass('invisibility').find('.list-social > li:last() > a') 2303 .blur(function () { 2304 el.attr('aria-expanded', 'false') 2305 .parent().removeClass('is-active'); 2306 isClicked = false; 2307 }); 2308 isClicked = true; 2309 } else { 2310 el.attr('aria-expanded', 'false').next().addClass('invisibility'); 2311 isClicked = false; 2312 } 2313 } 2314} 2315$(document).ready(function () { 2316 //-- maak box share toegankelijk 2317 boxShareAccessible('[data-toggle="socialsharebtn"]'); 2318}); 2319 2320//jQuery.fn.center = function () { 2321// this.css("position", "absolute"); 2322// this.css("top", ($(window).height() - this.outerHeight()) / 2 + "px"); 2323// this.css("left", ($(window).width() - this.outerWidth()) / 2 + "px"); 2324// return this; 2325//}; 2326 2327//// if ($('.popup-container').length > 0) { 2328//if ($('[data-popup=1]').length > 0) { 2329// // disableTabModalShown($('.popup-container')); 2330// disableTabModalShown($('.alertbanner')); 2331// $('html').addClass('no-scroll'); 2332// $('#outer-wrap').attr('aria-hidden', 'true'); 2333// isOverlay = true; 2334//} 2335 2336// $('.popup-overlay, .popup-close,.popup-content a').on('click',function (e) { 2337$('[data-alertbanner=close], [data-alertbanner=close] a').on('click', function (e) { 2338 var el = $(this); 2339 // var container = $('.popup-container,.sticky-container'); 2340 var container = $('.alertbanner'); 2341 container.hide(); 2342 var cookievalue = Cookie.get('Hidepopup'); 2343 var id = 2344 (typeof cookievalue !== 'undefined' && cookievalue !== '' 2345 ? cookievalue + ';' 2346 : '') + container.attr('data-id'); 2347 2348 Cookie.set('Hidepopup', container.attr('data-snooze'), id); 2349// $('html').removeClass('no-scroll'); 2350// $('#outer-wrap').removeAttr('aria-hidden'); 2351// $(document).off('keydown');
2352 // $('#inner-wrap').attr('tabindex', -1).focus(); 2353// $('body').children(':first-child').attr('tabindex', -1).trigger('focus'); 2354// isOverlay = false; 2355}); 2356 2357$(document).on('mouseover', '[data-popover]', function () { 2358 $(this).addClass('active'); 2359}) 2360 .on('mouseleave', '[data-popover]', function () { 2361 $(this).removeClass('active'); 2362 }).on('click', '[data-popover]', function () { 2363 $(this).toggleClass('active'); 2364 }); 2365 2366 2367var SpeechRecognition = { 2368 recognition: null, 2369 init: function () { 2370 var that = this; 2371 var hasSpeechRecognition = false; 2372 if (window.hasOwnProperty('webkitSpeechRecognition')) { 2373 that.recognition = new webkitSpeechRecognition(); 2374 hasSpeechRecognition = true; 2375 2376 } 2377 //else if (window.hasOwnProperty('SpeechRecognition')) { 2378 // that.recognition = new speechRecognition(); 2379 // hasSpeechRecognition = true; 2380 //} 2381 2382 2383 if (hasSpeechRecognition) { 2384 2385 $('#btn-speech-recognition').removeClass('hidden'); 2386 $(document).on('click', '#btn-speech-recognition', function () { 2387 var btn = $(this); 2388 that.listen(btn); 2389 }); 2390 } 2391 }, 2392 listen: function (btn) { 2393 var that = this; 2394 var txt = $('#lcp-searchbox-keyword'); 2395 $('#speech-error-msg').addClass('hidden'); 2396 $('#lcp-search-form').removeClass('speech-error'); 2397 txt.attr('placeholder', txt.attr('data-speak-text')); 2398 txt.val(''); 2399 btn.prop('disabled', true); 2400 2401 2402 that.recognition.continuous = false; 2403 that.recognition.interimResults = false; 2404 var lang = document.getElementsByTagName("html")[0].getAttribute("lang"); 2405 var langMap = { 2406 'nl': 'nl-BE', 2407 'fr': 'fr-BE', 2408 'en': 'en-GB', 2409 'de': 'de-DE' 2410 }; 2411 console.log(langMap[lang.substring(0, 2)] || 'en-US'); 2412 that.recognition.lang = langMap[lang.substring(0, 2)] || 'en-US'; 2413 2414 that.recognition.start(); 2415 that.recognition.onstart = function () { 2416 $('#lcp-search-form').addClass('listening'); 2417 2418 } 2419 that.recognition.onspeechstart = function () { 2420 2421 var text = txt.attr('data-listening-text'); 2422 txt.attr('placeholder', text); 2423 } 2424 that.recognition.onresult = function (e) { 2425 2426 if (typeof (e.results) == 'undefined') { 2427 that.clearSearch(btn,txt); 2428 return; 2429 } 2430 2431 var transcript = e.results[0][0].transcript.replace(/\./g, '') 2432 2433 2434 txt.val(transcript); 2435 that.clearSearch(btn,txt); 2436 $("#lcp-searchbox-keyword").trigger('focus'); 2437 searchCounter = 0; 2438 suggestionsearch(0); 2439 2440 2441 }; 2442 2443 that.recognition.onerror = function (e) { 2444 console.log(e); 2445 $('#lcp-search-form').addClass('speech-error'); 2446 $('#speech-error-msg').removeClass('hidden'); 2447 that.recognition.stop(); 2448 that.clearSearch(btn, txt); 2449 2450 2451 } 2452 2453 }, 2454 clearSearch: function (btn,txt) { 2455 var that = this; 2456 2457 $('#lcp-search-form').removeClass('listening'); 2458 var text = txt.attr('data-tooltip'); 2459 txt.attr('placeholder', text); 2460 btn.prop('disabled', false); 2461 } 2462 2463} 2464SpeechRecognition.init(); 2465document.addEventListener('load', function (event) { 2466 if (event.target.tagName === 'IMG' && event.target.closest('.loading-image')) { 2467 const elm = event.target.closest('.loading-image'); 2468 2469 if(elm) { 2470 elm.classList.remove('loading-image'); 2471 elm.classList.add('image-loaded'); 2472 } 2473 } 2474}, true); 2475document.addEventListener('DOMContentLoaded', () => { 2476 document.querySelectorAll('img[loading="lazy"]').forEach((imgElement) => { 2477 if (imgElement.complete) { 2478 const elm = imgElement.closest('.loading-image'); 2479 if (elm) { 2480 elm.classList.remove('loading-image'); 2481 elm.classList.add('image-loaded'); 2482 } 2483 } 2484 }); 2485}); 2486 2487//-- Variables 2488 2489var $window = $(window), 2490 gridFloatBreakpoint = 768 - getScrollbarWidth(), // grid float breakpoints: 320, 544, //--480px, 768px, 992px, 1200px 2491 gridFloatBreakpointMax = gridFloatBreakpoint - 1, 2492 isOverlay = false, 2493 stickySpacing = 0; 2494 2495//gebruikt om de scrollbar width te vinden toepasbaar om een goeie gridfloatbreakpoint berekening in javascript zie startup 2496 2497function getScrollbarWidth() { 2498 return window.innerWidth - document.documentElement.clientWidth; 2499} 2500 2501// $(document) 2502// .ready(function () { 2503$(function () { 2504 showVideo(); 2505 2506 2507 2508 //get focus class when inside searchfield 2509 // $('#lcp-searchbox-keyword') 2510 // .focus(function () { 2511 // $('.search__group').addClass('focus') 2512 // }) 2513 // .blur(function () { 2514 // $('.search__group') 2515 // .removeClass('focus') 2516 // }); 2517 2518 2519 // grid check van iconen op home op bais van de helper functie checkRow() in js\website\helpers\frontend.js 2520 /* 2521 if ($('.spotlight').find('.list.icons-big').length > 0) { 2522 checkRow('.list.icons-big', 'li'); 2523 } 2524 if ($('.spotlight').find('.list.icons-small').length > 0) { 2525 checkRow('.list.icons-small', 'li'); 2526 } 2527 */ 2528 2529 const homeTitleDeco = document.querySelector('.home__deco-title') 2530 if(homeTitleDeco) { 2531 if(homeTitleDeco.textContent === "arktos-www-home-deco-txt") { 2532 homeTitleDeco.classList.add('hidden'); 2533 } 2534 } 2535 2536 const heroInfos = document.querySelectorAll('[data-hero-info]'); 2537 heroInfos.forEach(heroInfo => { 2538 const toggleBtn = heroInfo.querySelector('[data-hero-toggle-panel]'); 2539 const closeBtn = heroInfo.querySelector('[data-hero-close-panel]'); 2540 const panel = heroInfo.querySelector(`#${toggleBtn.getAttribute('data-hero-toggle-panel')}`); 2541 2542 toggleBtn.addEventListener('click', () => { 2543 toggleBtn.classList.toggle('active'); 2544 logicPanel(); 2545 }); 2546 2547 closeBtn.addEventListener('click', () => { 2548 toggleBtn.classList.remove('active'); 2549 2550 logicPanel(); 2551 }); 2552 2553 const logicPanel = () => { 2554 const isOpen = toggleBtn.classList.contains('active'); 2555 toggleBtn.setAttribute('aria-expanded', isOpen? 'true' : 'false'); 2556 const txtTooltip = isOpen? toggleBtn.getAttribute('data-toggle-hide') : toggleBtn.getAttribute('data-toggle-show'); 2557 toggleBtn.setAttribute('data-tooltip', txtTooltip); 2558 2559 panel.classList.toggle('hidden'); 2560 panel.classList.toggle('open'); 2561 panel.setAttribute('aria-hidden', isOpen? 'false': 'true'); 2562 } 2563 }); 2564}).on('change', '#radius', function (e) { 2565 var div = $('#event-radius'); 2566 var sel = $(this); 2567 var val = sel.val(); 2568 if (val !== '') { 2569 div.removeClass('hidden'); 2570 $('#lbl-afstand-gemeente').html(sel.find('option:selected').html().substring(5)); 2571 } else { 2572 div.addClass('hidden'); 2573 $('#lbl-afstand-gemeente').html(''); 2574 } 2575 2576}).on('mouseover', '[data-tooltip]', function () { 2577 var btn = $(this); 2578 btn.attr('title', btn.attr('data-tooltip')); 2579 }) 2580 .on('mouseleave', '[data-tooltip]', function () { 2581 var btn = $(this); 2582 btn.removeAttr('title'); 2583 }) 2584 .on('click', 'button[data-toggle-items="1"]', function (e) { 2585 e.preventDefault(); 2586 var el = $(this); 2587 if (el.hasClass('active')) { 2588 el.attr('aria-expanded', 'false'); 2589 el.parent().removeClass('active'); 2590 $('#' + el.attr('data-id') + ' li.tohide').addClass('hidden'); 2591 el.removeClass('active').find('span').html(el.attr('data-show')); 2592 } else { 2593 el.parent().addClass('active'); 2594 $('#' + el.attr('data-id') + ' li.tohide').removeClass('hidden'); 2595 el.addClass('active').find('span').html(el.attr('data-hide')); 2596 el.attr('aria-expanded', 'true'); 2597 } 2598 }) 2599 .on('click', '[data-toggle-panel]', function (e) { 2600 e.preventDefault(); 2601 var btn = $(this); 2602 btn.toggleClass('active'); 2603 var open = btn.hasClass('active'); 2604 btn.attr('aria-expanded', open ? 'true' : 'false'); 2605 var txt = btn.attr('data-toggle-panel' + (open ? 'hide' : 'show')); 2606 btn.attr('data-tooltip', txt); 2607 btn.find('span.txt').html(txt); 2608 var panel = $('#' + btn.attr('data-toggle-panel')); 2609 panel.toggleClass('hidden'); 2610 panel.attr('aria-hidden', open ? 'false' : 'true'); 2611 panel.closest('fieldset').toggleClass('open'); 2612 }) 2613 .on('click', '#btn-toggle-contrast', function (e) { 2614 var el = $(this); 2615 2616 var css = $('#skin-stylesheet'); 2617 if (el.hasClass('is-active')) { 2618 Cookie.remove(css.attr('data-css')); 2619 } else { 2620 Cookie.set(css.attr('data-css'), 1000, '1'); 2621 } 2622 window.location.reload(); 2623 }) 2624 .on('click', '[data-toggle-accordion]', function (e) { 2625 var btn = $(this); 2626 var accordion = $('#' + btn.attr('aria-controls')); 2627 var expanded = btn.attr('aria-expanded') === 'true'; 2628 2629 accordion.toggleClass('hidden'); 2630 btn.attr('aria-expanded', expanded ? 'false' : 'true'); 2631 if (btn.attr('data-icon-active') !== undefined) { 2632 if (expanded) { 2633 btn.parent('li').removeClass('active'); 2634 btn.find('use').attr('href', btn.attr('data-icon-inactive')); 2635 } else { 2636 btn.parent('li').addClass('active'); 2637 btn.find('use').attr('href', btn.attr('data-icon-active')); 2638 } 2639 } 2640 if (btn.attr('data-toggle-hide') !== undefined) { 2641 var txt = btn.attr('data-toggle-' + (expanded ? 'hide' : 'show')); 2642 btn.find('span').html(txt); 2643 btn.attr('data-tooltip', txt); 2644 } 2645 }) 2646 .on('change', '.checkboxlist-item input[data-parentid]', function () { 2647 var chk = $(this); 2648 var id = chk.val(); 2649 var checked = chk.is(':checked'); 2650 var parentid = chk.attr('data-parentid'); 2651 if (parentid == 0) { 2652 $('.checkboxlist-item input[data-parentid="' + id + '"]').prop( 2653 'checked', 2654 checked 2655 ); 2656 } else if (checked == false) { 2657 $('.checkboxlist-item input[value="' + parentid + '"]').prop( 2658 'checked', 2659 false 2660 ); 2661 } 2662 }) 2663 .on('click', 'button.btn-chklist-toggle', function (e) { 2664 var btn = $(this); 2665 btn.toggleClass('active'); 2666 var open = btn.hasClass('active'); 2667 btn.attr('aria-expanded', open ? 'true' : 'false'); 2668 var txt = btn.attr('data-toggle-' + (open ? 'hide' : 'show')); 2669 btn.find('span').html(txt); 2670 btn.attr('data-tooltip', txt); 2671 var control = btn.attr('aria-controls'); 2672 var panel = $('#' + control); 2673 panel.toggleClass('hidden'); 2674 panel.attr('aria-hidden', open ? 'false' : 'true'); 2675 }).on('click', 'button[data-readmore]', function (e) { 2676 var btn = $(this); 2677 btn.toggleClass('active'); 2678 var active = btn.hasClass('active'); 2679 btn.find('span').html(btn.attr('data-' + (active ? 'close' : 'open'))); 2680 $('#' + btn.attr('data-readmore')).attr('data-read-more', active ? 'false' : 'true'); 2681 }).on('click', "#playpausevideo", function () { 2682 // var videoelement = $(this).parent().closest('video'); 2683 var myVideo = document.getElementById("video-to-play"); 2684 if (myVideo.paused) { 2685 myVideo.play(); 2686 $("#playpausevideo").addClass("active"); 2687 } else { 2688 myVideo.pause(); 2689 $("#playpausevideo").removeClass("active"); 2690 } 2691 }); 2692 2693$(window).on('resize', function (e) { 2694 setSearchPlaceholder(); 2695 showVideo(); 2696}); 2697 2698function showVideo() { 2699 var v = $('#video-source'); 2700 if (v.length > 0) { 2701 if ( $(window).width() >= gridFloatBreakpoint && !v.hasClass('video-loaded')) { 2702 var src = v.attr('data-src'); 2703 if (src != '') { 2704 v.addClass('video-loaded'); 2705 v.html('<video id="video-to-play" loop muted autoplay><source src="' + src + '" type="video/mp4" />Your browser does not support the video tag.</video>'); 2706 try { 2707 document.getElementById("video-to-play").play(); 2708 $("#playpausevideo").addClass("active"); 2709 } catch (e) { } 2710 } 2711 } 2712 else if ($(window).width() <= gridFloatBreakpointMax) { 2713 try { 2714 $("#playpausevideo").removeClass("active "); 2715 v.removeClass('video-loaded').children().remove(); 2716 } catch (e) { } 2717 } 2718 } 2719}
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.