{"version":3,"sources":["panels.js"],"names":["define","$","panel","parentChildSelectors","parentSelector","childSelector","resizeThings","containerSelector","each","$eles","this","find","removeAttr","closest","length","heights","push","outerHeight","css","height","Utilities","max","window","on","me","setTimeout","e"],"mappings":"YAEAA,QAAO,WACHC,EAAE,WAGE,GAAIC,IAEAC,uBACMC,eAAgB,6BAAsCC,cAAe,qBACrED,eAAgB,qCAAsCC,cAAe,gBACrED,eAAgB,6BAAsCC,cAAe,mBAG3EC,aAAc,SAAUC,EAAmBF,GACvCJ,EAAEM,GAAmBC,KAAK,WAEtB,GAAIC,GAAQR,EAAES,MAAMC,KAAKN,EAKzB,IAJAI,EAAMG,WAAW,UAIdH,EAAMI,QAAQ,8BAA8BC,OAA/C,CAIA,GAAIC,KACJN,GAAMD,KAAK,WACPO,EAAQC,KAAKf,EAAES,MAAMO,iBAGzBR,EAAMS,KAAMC,OAAUC,UAAUC,IAAIN,SAKhDd,GAAEqB,QAAQC,GAAG,OAAQ,WACjBtB,EAAEO,KAAKN,EAAMC,qBAAsB,WAC/BD,EAAMI,aAAaI,KAAKN,eAAgBM,KAAKL,mBAElDkB,GAAG,SAAU,WACZtB,EAAEO,KAAKN,EAAMC,qBAAsB,WAC/B,GAAIqB,GAAKd,IACTe,YAAW,WACPvB,EAAMI,aAAakB,EAAGpB,eAAgBoB,EAAGnB,gBAC1C,SAIXJ,EAAE,wBAAwBsB,GAAG,eAAgB,SAAUG,GACnDzB,EAAEO,KAAKN,EAAMC,qBAAsB,WAC/B,GAAIqB,GAAKd,IACTe,YAAW,WACPvB,EAAMI,aAAakB,EAAGpB,eAAgBoB,EAAGnB,gBAC1C","file":"panels.js","sourcesContent":["/*global define */\r\n/* PANELS */\r\ndefine(function () {\r\n $(function () {\r\n\r\n // Ensure all children within a container have equal-height\r\n var panel = {\r\n\r\n parentChildSelectors: [\r\n { parentSelector: '.container.panel-container', childSelector: '.panel-header h3' },\r\n { parentSelector: '.container.tab-container .tab-pane', childSelector: '.archive h6' },\r\n { parentSelector: '.container.panel-container', childSelector: '.panel-content' }\r\n ],\r\n\r\n resizeThings: function (containerSelector, childSelector) {\r\n $(containerSelector).each(function () {\r\n // Remove any previously-added styles\r\n var $eles = $(this).find(childSelector);\r\n $eles.removeAttr('style');\r\n \r\n //skip if children elements are inside max-1, \r\n //i.e. don't equalize height when elements are arranged in one column\r\n if($eles.closest('.max-1, .no-equalize-items').length){\r\n return;\r\n }\r\n // Create array of heights\r\n var heights = [];\r\n $eles.each(function () {\r\n heights.push($(this).outerHeight());\r\n });\r\n // Set height of all children to the tallest\r\n $eles.css({ 'height': Utilities.max(heights) });\r\n });\r\n }\r\n };\r\n\r\n $(window).on(\"load\", function () {\r\n $.each(panel.parentChildSelectors, function () {\r\n panel.resizeThings(this.parentSelector, this.childSelector);\r\n }); \r\n }).on(\"resize\", function () {\r\n $.each(panel.parentChildSelectors, function () {\r\n var me = this;\r\n setTimeout(function(){\r\n panel.resizeThings(me.parentSelector, me.childSelector);\r\n }, 100);\r\n }); \r\n });\r\n // Resize panel headers if they become shown from a tab\r\n $(\"a[data-toggle='tab']\").on(\"shown.bs.tab\", function (e) {\r\n $.each(panel.parentChildSelectors, function () {\r\n var me = this;\r\n setTimeout(function () {\r\n panel.resizeThings(me.parentSelector, me.childSelector);\r\n }, 100);\r\n });\r\n });\r\n });\r\n});"]}