{"version":3,"file":"Diagram.Toggle.061e142f.js","sources":["../src/current/js/modules/Diagram.Toggle.js"],"sourcesContent":["export async function DiagramToggle($toggle, callback) {\r\n // this will toggle the .active class of a targeted element (and its trigger) via a separate trigger (e.g. button)\r\n // basic usage\r\n // - add a class to your target element (e.g. .js-my-target)\r\n // - add the .js-toggle class to your trigger element\r\n // - add the data-toggle-target=\".js-my-target\" attribute to trigger element and set the value to match the class on your target element\r\n \r\n callback = callback || null;\r\n var targetVal = $toggle.data('toggle-target');\r\n var $targetElement = $(targetVal);\r\n // find all triggers with a related target (data-target attribute)\r\n var $triggerElements = $('[data-toggle-target=\"' + targetVal + '\"]');\r\n var isActive = $targetElement.hasClass('active') ? true : false;\r\n\r\n if (isActive) {\r\n $triggerElements.removeClass('active');\r\n $targetElement.removeClass('active');\r\n isActive = false;\r\n } else {\r\n $triggerElements.addClass('active');\r\n $targetElement.addClass('active');\r\n isActive = true;\r\n }\r\n\r\n $triggerElements.blur();\r\n\r\n if (callback != null) {\r\n return callback(isActive);\r\n }\r\n}"],"names":["DiagramToggle","$toggle","callback","targetVal","$targetElement","$triggerElements","isActive"],"mappings":"AAAO,eAAeA,EAAcC,EAASC,EAAU,CAOnDA,EAAWA,GAAY,KACvB,IAAIC,EAAYF,EAAQ,KAAK,eAAe,EACxCG,EAAiB,EAAED,CAAS,EAE5BE,EAAmB,EAAE,wBAA0BF,EAAY,IAAI,EAC/DG,EAAW,EAAAF,EAAe,SAAS,QAAQ,EAc/C,GAZIE,GACAD,EAAiB,YAAY,QAAQ,EACrCD,EAAe,YAAY,QAAQ,EACnCE,EAAW,KAEXD,EAAiB,SAAS,QAAQ,EAClCD,EAAe,SAAS,QAAQ,EAChCE,EAAW,IAGfD,EAAiB,KAAI,EAEjBH,GAAY,KACZ,OAAOA,EAASI,CAAQ,CAEhC"}