(function ($) { Drupal.behaviors.qconbs = { attach: function (context, settings) { "use strict"; window.addEventListener('scroll', function(e){ var distanceY = window.pageYOffset || document.documentElement.scrollTop, shrinkOn = 200, // How many pixels does the window have to scroll before the header shrinks header = $(".qcon-base-top"); if (distanceY > shrinkOn) { header.addClass("smaller"); } else { if (header.hasClass("smaller")) { header.removeClass("smaller"); } } }); $('#topLeftSlider').once('topLeftSliderProcessed', function () { $('#topLeftSlider').carousel({interval: 3000}); $('#topLeftSlider .slide2').on('click tap', function(e) { //w3c: e.preventDefault(); e.stopPropagation(); //IE: e.returnValue = false; e.cancelBubble = true; window.location.href = $(this).data('destination'); }); $('#topLeftSlider .slide3').on('click tap', function(e) { //w3c: e.preventDefault(); e.stopPropagation(); //IE: e.returnValue = false; e.cancelBubble = true; $('html, body').animate({ scrollTop: $($(this).data('destination')).offset().top - $('.qcon-base-top').innerHeight() + 40 }, 3000); }); }); //initialize eqHegth $('.past-years-flex-align').eqHeight('.panel'); $('#views-bootstrap-carousel-1').on('slide.bs.carousel', function () { $(window).resize(); }) $('#comments-collapse').click(function(e) { $('#comments-content-wrapper').toggle('slow'); $(this).text() == 'Expand' ? $(this).text('Collapse') : $(this).text('Expand'); }); var config = { duration: 800, origin: 'bottom', viewFactor: 0.25, distance: "50px", scale: "1,0.85", } if(typeof ScrollReveal !== 'undefined' && window.location.hash == ''){ if(typeof window.sr === 'undefined'){ window.sr = ScrollReveal(config); } sr.reveal('.qcon-sr-home'); sr.reveal('.qcon-sr-home.delay0',{delay: 200}); sr.reveal('.qcon-sr-home.delay1',{delay: 400}); sr.reveal('.qcon-sr-home.delay2',{delay: 600}); } $('.phv[data-video]').click(function(e){ var $video = $(''); var $target = $(this); $video.attr('src',$(this).data('video')); if($(this).data('width')){ $video.attr('width',$(this).data('width')) } if($(this).data('height')){ $video.attr('height',$(this).data('height')) } if($(this).data('target')){ $target = $($(this).data('target')); } $target.replaceWith($video); $(".container").fitVids(); }); //GA tracking sponsor collateral downloads $('.sponsor').click(function() { ga('send', 'event', 'Sponsor Collateral', 'click', $(this).attr('data-sponsor') + ' - collateral download'); }); } }; })(jQuery); ; (function ($) { Drupal.behaviors.qconbs_restable = { attach: function (context, settings) { "use strict"; var switched = false; var updateTables = function() { if (($(window).width() < 767) && !switched ){ switched = true; $("table.responsive").each(function(i, element) { splitTable($(element)); }); return true; } else if (switched && ($(window).width() > 767)) { switched = false; $("table.responsive").each(function(i, element) { unsplitTable($(element)); }); } }; $(window).load(updateTables); $(window).on("redraw",function(){switched=false;updateTables();}); // An event to listen for $(window).on("resize", updateTables); function splitTable(original) { original.wrap("
"); var copy = original.clone(); copy.find("td:not(:first-child), th:not(:first-child)").css("display", "none"); copy.removeClass("responsive"); original.closest(".table-wrapper").append(copy); copy.wrap(""); original.wrap(""); setCellHeights(original, copy); } function unsplitTable(original) { original.closest(".table-wrapper").find(".pinned").remove(); original.unwrap(); original.unwrap(); } function setCellHeights(original, copy) { var tr = original.find('tr'), tr_copy = copy.find('tr'), heights = []; tr.each(function (index) { var self = $(this), tx = self.find('th, td'); tx.each(function () { var height = $(this).outerHeight(true); //fix to avoid rowspan problem on tutorials if($(this).attr('rowspan') > 1){ height = 0; } heights[index] = heights[index] || 0; if (height > heights[index]) heights[index] = height; }); }); tr_copy.each(function (index) { $(this).height(heights[index]); }); } } }; })(jQuery); ; // Generated by CoffeeScript 1.4.0 /* eqHeight.coffee v1.2.8 http://jsliang.github.com/eqHeight.coffee Copyright (c) 2013, Jui-Shan Liang