1(function ($) { 2 3"use strict"; 4 5 /** 6 * Attaches menu styles to menu blocks. Currently only the "dropdown" style. 7 */ 8Backdrop.behaviors.menuStyles = { 9 attach: function(context, settings) { 10 var $menus = $(context).find('[data-menu-style]').once('menu-style'); 11 $menus.each(function() { 12 var element = this; 13 var $menu = $(element); 14 var style = $menu.data('menuStyle'); 15 var menuSettings = $menu.data('menuSettings'); 16 if ($menu.data('clickdown')) { 17 menuSettings = $.extend(menuSettings, { 18 noMouseOver: true 19 }); 20 } 21 menuSettings = $.extend(menuSettings, { 22 collapsibleBehavior: ($menu.data('collapse')) ? ($menu.data('collapse')) : 'default' 23 }); 24 if (Backdrop.menuStyles[style]) { 25 Backdrop.menuStyles[style].attach(element, menuSettings); 26 } 27 }); 28 }, 29 detach: function(context, settings) { 30 var $menus = $(context).find('[data-menu-style]').once('menu-style'); 31 $menus.each(function() { 32 var element = this; 33 var $menu = $(element); 34 var style = $menu.data('menuStyle'); 35 var menuSettings = $menu.data('menuSettings'); 36 if (Backdrop.menuStyles[style] && Backdrop.menuStyles[style].detach) { 37 Backdrop.menuStyles[style].detach(element, menuSettings); 38 } 39 }); 40 } 41}; 42 43Backdrop.menuStyles = {}; 44Backdrop.menuStyles.dropdown = { 45 attach: function(element, settings) { 46 // Set defaults for the settings. 47 settings = $.extend(settings, { 48 subIndicatorsPos: 'append', 49 subIndicatorsText: '' 50 }); 51 $(element).addClass('sm').smartmenus(settings); 52 } 53}; 54 55/** 56 * Adds a collapsible "hamburger" button to toggle links if enabled on a menu. 57 */ 58Backdrop.behaviors.menuToggles = { 59 attach: function(context, settings) { 60 var $menus = $(context).find('[data-menu-toggle-id]').once('menu-toggles'); 61 $menus.each(function() { 62 var element = this; 63 var $menu = $(element); 64 var id = $menu.data('menuToggleId'); 65 var $menuToggleState = $('#' + id); 66 $menuToggleState.on('change', function(e) { 67 // Animate mobile menu. 68 if (this.checked) { 69 $menu.hide().slideDown(250, function() { $menu.css('display', ''); }); 70 } else { 71 $menu.show().slideUp(250, function() { $menu.css('display', ''); }); 72 } 73 }); 74 // Hide mobile menu beforeunload. 75 $(window).on('beforeunload unload', function() { 76 if ($menuToggleState[0].checked) { 77 $menuToggleState[0].click(); 78 } 79 }); 80 }); 81 } 82}; 83 84})(jQuery); 85; 86(function ($) { 87 88$(document).ready(function() { 89 90 // Attach mousedown, keyup, touchstart events to document only and catch 91 // clicks on all elements. 92 $(document.body).bind("mousedown keyup touchstart", function(event) { 93 94 // Catch the closest surrounding link of a clicked element. 95 $(event.target).closest("a,area").each(function() { 96 97 if (Backdrop.settings.matomo.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 98 // Mailto link clicked. 99 _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]); 100 } 101 102 }); 103 }); 104 105 // Colorbox: This event triggers when the transition has completed and the 106 // newly loaded content has been revealed. 107 if (Backdrop.settings.matomo.trackColorbox) { 108 $(document).bind("cbox_complete", function () { 109 var href = $.colorbox.element().attr("href"); 110 if (href) { 111 _paq.push(["setCustomUrl", href]); 112 _paq.push(["trackPageView"]); 113 } 114 }); 115 } 116 117}); 118 119})(jQuery); 120;
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.