{"version":3,"file":"popup.min.js","sources":["popup.js"],"sourcesContent":["/**\n * Copied from the Social Share contrib module\n * https://www.drupal.org/project/social_share\n */\n(function (Drupal) {\n 'use strict';\n\n function windowPopup(url, width, height) {\n // Calculate the position of the popup so\n // it’s centered on the screen.\n var left = (screen.width / 2) - (width / 2),\n top = (screen.height / 2) - (height / 2);\n\n width = Math.min(width, screen.width);\n height = Math.min(height, screen.height);\n\n window.open(\n url,\n \"\",\n \"menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=\" + width + \",height=\" + height + \",top=\" + top + \",left=\" + left\n );\n }\n\n Drupal.behaviors.socialSharePopup = {\n attach: function (context, settings) {\n var links = context.querySelectorAll(\".js-social-share-popup\");\n if (links) {\n [].forEach.call(links, function(anchor) {\n anchor.addEventListener(\"click\", function(e) {\n e.preventDefault();\n\n var width = anchor.getAttribute('data-popup-width');\n var height = anchor.getAttribute('data-popup-height');\n\n windowPopup(this.href, width ? width: 500, height ? height : 300);\n });\n });\n }\n }\n };\n\n})(Drupal);\n"],"names":["Drupal","behaviors","socialSharePopup","attach","context","settings","links","querySelectorAll","forEach","call","anchor","addEventListener","e","preventDefault","url","left","top","width","getAttribute","height","this","href","screen","Math","min","window","open"],"mappings":"AAyCGA,OAlBMC,UAAUC,iBAAmB,CAClCC,OAAQ,SAAUC,EAASC,GACrBC,EAAQF,EAAQG,iBAAiB,wBAAwB,EACzDD,GACF,GAAGE,QAAQC,KAAKH,EAAO,SAASI,GAC9BA,EAAOC,iBAAiB,QAAS,SAASC,GACxCA,EAAEC,eAAe,EAEjB,IAxBWC,EAGfC,EACFC,EAoBUC,EAAQP,EAAOQ,aAAa,kBAAkB,EAC9CC,EAAST,EAAOQ,aAAa,mBAAmB,EAzBzCJ,EA2BCM,KAAKC,KA3BDJ,EA2BOA,GAAe,IA3BfE,EA2BoBA,GAAkB,IAxBjEJ,EAAQO,OAAOL,MAAQ,EAAMA,EAAQ,EACvCD,EAAOM,OAAOH,OAAS,EAAMA,EAAS,EAExCF,EAAQM,KAAKC,IAAIP,EAAOK,OAAOL,KAAK,EACpCE,EAASI,KAAKC,IAAIL,EAAQG,OAAOH,MAAM,EAEvCM,OAAOC,KACLZ,EACA,GACA,4DAA8DG,EAAQ,WAAaE,EAAS,QAAUH,EAAM,SAAWD,CACzH,CAeM,CAAC,CACH,CAAC,CAEL,CACF"}