{"version":3,"sources":["webpack://gli-frontend/../web/themes/custom/gilderlehrman_theme/src/js/functions/gli__touchClick.js","webpack://gli-frontend/../web/themes/custom/gilderlehrman_theme/src/js/gli__toggle-past-journals.js"],"names":["sel","once","fnc","jQuery","on","event","preventDefault","handled","$","Drupal","behaviors","togglePastJournals","attach","context","touchClick","hasClass","slideUp","removeClass","slideDown","addClass"],"mappings":"mBAoCA,QAjBmB,SAACA,EAAKC,EAAMC,GAC7BC,OAAOF,EAAKD,EAAKA,IACdI,GAAG,oBAAoB,SAACC,GAMvB,GADAA,EAAMC,kBACgB,IAAlBD,EAAME,QAIR,OAAO,EAHPL,EAAIG,GACJA,EAAME,SAAU,OCtBxB,SAAEC,EAAGC,EAAQR,GAIXQ,EAAOC,UAAUC,mBAAqB,CACpCC,OADoC,SAC7BC,GAELC,EAAW,mBAAoBb,GAAK,WAC9BO,EAAE,kBAAmBK,GAASE,SAAS,WACzCP,EAAE,iCAAkCK,GAASG,UAC7CR,EAAE,kBAAmBK,GAASI,YAAY,YAE1CT,EAAE,iCAAkCK,GAASK,YAC7CV,EAAE,kBAAmBK,GAASM,SAAS,gBAbjD,CAkBGhB,OAAQM,OAAQR,O","file":"/js/gli__toggle-past-journals.js","sourcesContent":["/**\n * @file\n * GilderLehrman Theme Shared Functions.\n */\n\n/**\n * Touch and click listening function\n * Original code from {@link http://output.jsbin.com/ijizat/25}\n *\n * @param {string} sel - A jQuery selector\n * @param {function} once - Function to run once\n * @param {function} fnc - Function to run upon touch or click\n *\n * @example\n *\n * touchClick(\"#id-click\", function() {\n * $(\"#id-affected\").toggleClass('new-class');\n * });\n */\nconst touchClick = (sel, once, fnc) => {\n jQuery(once(sel, sel))\n .on(\"touchstart click\", (event) => {\n /*\n * Propagation allows the tooltip to clear when clicking.\n * event.stopPropagation();\n */\n event.preventDefault();\n if (event.handled !== true) {\n fnc(event);\n event.handled = true;\n } else {\n return false;\n }\n });\n};\n\nexport default touchClick;\n","/**\n * @file\n * GilderLehrman Toggle Past Journals behaviors.\n */\n\nimport touchClick from \"./functions/gli__touchClick\";\n\n(($, Drupal, once) => {\n /**\n * Behavior description.\n */\n Drupal.behaviors.togglePastJournals = {\n attach(context) {\n // Browse Journals: Toggle Past Journals\n touchClick(\"#browse-journals\", once,() => {\n if ($(\".journal-header\", context).hasClass(\"active\")) {\n $(\".journal-header .past-journals\", context).slideUp();\n $(\".journal-header\", context).removeClass(\"active\");\n } else {\n $(\".journal-header .past-journals\", context).slideDown();\n $(\".journal-header\", context).addClass(\"active\");\n }\n });\n },\n };\n})(jQuery, Drupal, once);\n"],"sourceRoot":""}