/** * @file * A JavaScript file for the theme. */ // JavaScript should be made compatible with libraries other than jQuery by // wrapping it with an "anonymous closure". See: // - https://drupal.org/node/1446420 // - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth (function ($, Drupal, window, document, undefined) { // To understand behaviors, see https://drupal.org/node/756722#behaviors Drupal.behaviors.housegovMobilealert = { attach: function(context, settings) { var width = $(window).width(); if (width < 590) { $('#housegov-alert-block').prependTo('#main-content-section'); } } }; Drupal.behaviors.housegovRepsTabs = { attach: function(context, settings) { // Bootstrap tabs for reps Blocks // Wrap representatives views blocks with bootstrap tabs class $('.housegov-reps-tab-item').wrapAll("
"); } }; })(jQuery, Drupal, this, this.document);