{"version":3,"sources":["01-atoms/04-images/00-image/sidebar-image.js"],"names":["$","Drupal","breakpoint","behaviors","sidebarImage","attach","registerResizeFunction","sidebarImageMove","$sidebarImg","$sidebarText","valueInArray","insertAfter","value","insertBefore","setTimeout","addClass","jQuery"],"mappings":"aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BA,CAAC,SAAUA,CAAV,CAAaC,CAAb,CAAqBC,CAArB,CAAiC,CAEhC,aAEAD,CAAM,CAACE,SAAP,CAAiBC,YAAjB,CAAgC,CAC9BC,MAAM,CAAE,YAA6B,CAenC;AACAH,CAAU,CAACI,sBAAX,CAAkC,kBAAlC,CAduB,QAAnBC,CAAAA,CAAmB,EAAY,IAC7BC,CAAAA,CAAW,CAAGR,CAAC,CAAC,8FAAD,CADc,CAE7BS,CAAY,CAAGT,CAAC,CAAC,kFAAD,CAFa,CAG7BE,CAAU,CAACQ,YAAX,CAAwB,CAAC,QAAD,CAAW,OAAX,CAAoB,OAApB,CAA6B,QAA7B,CAAxB,CAH6B,EAI/BF,CAAW,CAACG,WAAZ,CAAwBF,CAAxB,CAJ+B,CAMR,QAArB,GAAAP,CAAU,CAACU,KANkB,EAO/BJ,CAAW,CAACK,YAAZ,CAAyBJ,CAAzB,CAP+B,CASjCK,UAAU,CAAC,UAAU,CACnBN,CAAW,CAACO,QAAZ,CAAqB,UAArB,CACD,CAFS,CAEP,CAFO,CAGX,CAED,CACD,CAlB6B,CAqBjC,CAzBD,EAyBGC,MAzBH,CAyBWf,MAzBX,CAyBmBC,UAzBnB,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 Drupal.behaviors.sidebarImage = {\n attach: function (context, settings) {\n\n var sidebarImageMove = function () {\n var $sidebarImg = $('.field--name-field-content-sidebar .media-position-right .field--name-field-media-text-media');\n var $sidebarText = $('.field--name-field-content-sidebar .media-position-right .field--name-field-text');\n if (breakpoint.valueInArray(['xsmall', 'small', 'large', 'xlarge'])) {\n $sidebarImg.insertAfter($sidebarText);\n } \n if (breakpoint.value === 'medium') {\n $sidebarImg.insertBefore($sidebarText);\n }\n setTimeout(function(){\n $sidebarImg.addClass('js-added');\n }, 0);\n };\n // trigger functon when hitting a new breakpoint\n breakpoint.registerResizeFunction('sidebarImageMove', sidebarImageMove);\n },\n };\n \n})(jQuery, Drupal, breakpoint);\n"],"file":"sidebar-image.js"}