{"version":3,"sources":["00-base/global/responsive.js"],"names":["$","Drupal","breakpoint","behaviors","widthClass","attach","registerResizeFunction","addWidthClass","value","addClass","removeClass","jQuery"],"mappings":"aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BA,CAAC,SAAUA,CAAV,CAAaC,CAAb,CAAqBC,CAArB,CAAiC,CAEhC,aAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEAD,CAAM,CAACE,SAAP,CAAiBC,UAAjB,CAA8B,CAC5BC,MAAM,CAAE,YAA6B,CACnC;AAcA;AACAH,CAAU,CAACI,sBAAX,CAAkC,eAAlC,CAdoB,QAAhBC,CAAAA,CAAgB,EAAY,CACL,QAArB,GAAAL,CAAU,CAACM,KADe,CAE5BR,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmB,QAAnB,EAA6BC,WAA7B,CAAyC,2BAAzC,CAF4B,CAGE,OAArB,GAAAR,CAAU,CAACM,KAHQ,CAI5BR,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmB,OAAnB,EAA4BC,WAA5B,CAAwC,4BAAxC,CAJ4B,CAKE,QAArB,GAAAR,CAAU,CAACM,KALQ,CAM5BR,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmB,QAAnB,EAA6BC,WAA7B,CAAyC,2BAAzC,CAN4B,CAOE,OAArB,GAAAR,CAAU,CAACM,KAPQ,CAQ5BR,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmB,OAAnB,EAA4BC,WAA5B,CAAwC,4BAAxC,CAR4B,CASE,QAArB,GAAAR,CAAU,CAACM,KATQ,EAU5BR,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmB,QAAnB,EAA6BC,WAA7B,CAAyC,2BAAzC,CAEH,CAED,CACD,CAlB2B,CAoB/B,CA3CD,EA2CGC,MA3CH,CA2CWV,MA3CX,CA2CmBC,UA3CnB,C","sourcesContent":["/**\n * @file\n * Contains custom functionality related to positioning and moving elements\n * based on the viewport size. This file should be used for global responsive JS -\n * anything component-based, or responsive JS that is only called contextually\n * should go in a separate JS file... as should any code limited to specific parts\n * of the page that are complicated and deserve their own file (to avoid making this file massive).\n *\n * Utilize Drupal behaviors. They are applied consistently when the page is first loaded and\n * then when new content is added during AHAH/AJAX requests.\n *\n * JavaScript API overview: https://www.drupal.org/docs/8/api/javascript-api/javascript-api-overview\n *\n * Avoid processing the same element multiple times within Drupal behaviors.\n * Use the jQuery Once plugin that's bundled with core:\n * $('.foo', context).once('foo').css('color', 'red');\n *\n * Practice DRY techniques:\n * https://learn.jquery.com/code-organization/dont-repeat-yourself\n * https://brandoncodes.wordpress.com/2012/06/29/making-some-simple-jquery-code-more-efficient\n *\n * Use helper functions to further DRY up your code:\n * http://joecritchley.com/articles/dry-chaining-jquery\n *\n * This file uses functions provided by the advo_breakpoint module.\n * It must be installed and enabled to work.\n *\n */\n(function ($, Drupal, breakpoint) {\n\n 'use strict';\n\n // Example of responsive function\n // Drupal.behaviors.testResponsive = {\n // attach: function (context, settings) {\n // var responsiveTest = function() {\n // if (breakpoint.value === 'xlarge') {\n // console.log('xlarge');\n // }\n // if (breakpoint.valueInArray(['medium', 'large'])) {\n // console.log('medium or large');\n // }\n // // Fallback to smallest breakpoint(s).\n // else {\n // console.log('small');\n // }\n // }\n // breakpoint.registerResizeFunction('responsiveTest', responsiveTest);\n // }\n // };\n\n Drupal.behaviors.widthClass = {\n attach: function (context, settings) {\n // Adds a class to the HTML depending on what breakpoint the window is within.\n var addWidthClass = function () {\n if (breakpoint.value === 'xsmall') {\n $('html').addClass('xsmall').removeClass('small medium large xlarge');\n } else if (breakpoint.value === 'small') {\n $('html').addClass('small').removeClass('xsmall medium large xlarge');\n } else if (breakpoint.value === 'medium') {\n $('html').addClass('medium').removeClass('xsmall small large xlarge');\n } else if (breakpoint.value === 'large') {\n $('html').addClass('large').removeClass('xsmall medium small xlarge');\n } else if (breakpoint.value === 'xlarge') {\n $('html').addClass('xlarge').removeClass('xsmall medium large small');\n }\n };\n // trigger functon when hitting a new breakpoint\n breakpoint.registerResizeFunction('addWidthClass', addWidthClass);\n },\n };\n})(jQuery, Drupal, breakpoint);\n"],"file":"responsive.js"}