{"version":3,"file":"sm.portal.ui.slidePane.min.js","names":["jQuery","undefined","sm","window","windowProxy","actionQueue","initSlidepane","unobtrusiveSlidepaneWiring","portal","ui","slidepane","stickySlideup","slidepaneResize","not","each","that","this","$mySlideup","attr","opencb","is","openargs","closecb","closeargs","on","hasClass","closeThisSlideup","openStickySlideup","mySlideup","slideup","cb","args","utility","isNullOrEmpty","relatedButton","transitionEnded","whichTransitionEvent","addClass","closeAllSlideups","removeClass","fixStickySlideupPosition","transitionEndFired","one","openSlideupInternal","setTimeout","modalTabbing","originalPosition","closeSlideupInternal","focus","visibleSlideups","theme","freezeContent","slideupContentHeights","removeAttr","executeFunctionByName","unfreezeContent","eval","footerButtonsHeight","outerHeight","css","exclusionHeight","activeSlideup","totalHeight","innerHeight","headerToExclude","find","whichScenario","children","sliderContentHeight","checkoutFooterToExclude","height","onDelayed","extend","document","bind"],"sources":["assets/js/ui/sm.portal.ui.slidePane.js"],"mappings":"CAEA,SAAWA,OAAQC,WACf,IAAIC,GAAKC,OAAOD,GAAKC,OAAOD,IAAM,CAAC,EAC/BE,YACAC,YAAc,GAYlB,SAASC,gBACLC,4BACJ,CAEA,SAASA,6BACLL,GAAGM,OAAOC,GAAGC,UAAUC,gBACvBT,GAAGM,OAAOC,GAAGC,UAAUE,iBAC3B,CAGA,SAASD,gBAELX,OAAO,2BAA2Ba,IAAI,2BAA2BC,MAAK,WAClE,IAAIC,EAAOf,OAAOgB,MACdC,EAAajB,OAAO,IAAMe,EAAKG,KAAK,0BAGpCC,EAASJ,EAAKK,GAAG,yBAA2BL,EAAKG,KAAK,uBAAyB,KAC/EG,EAAWN,EAAKK,GAAG,8BAAgCL,EAAKG,KAAK,4BAA8B,KAC3FI,EAAUP,EAAKK,GAAG,2BAA8BL,EAAKG,KAAK,yBAA2B,KACrFK,EAAYR,EAAKK,GAAG,gCAAkCL,EAAKG,KAAK,8BAAgC,KAEpGH,EAAKS,GAAG,SAAS,WACRT,EAAKU,SAAS,UAIfvB,GAAGM,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vBtC,GAAGM,OAAOC,GAAGC,UAAU0C,uBAC3B,GACJ,MA1PyB,IAAdlD,GAAGM,QACVR,OAAOwE,OAAOtE,GAAI,CAAEM,OAAQ,CAAC,SAEL,IAAjBN,GAAGM,OAAOC,IACjBT,OAAOwE,OAAOtE,GAAGM,OAAQ,CAAEC,GAAI,CAAC,SAEE,IAA3BP,GAAGM,OAAOC,GAAGC,WACpBV,OAAOwE,OAAOtE,GAAGM,OAAOC,GAAI,CAAEC,UAAW,CAAC,IAsP9CV,OAAOwE,QAAO,EAAMtE,GAAGM,OAAOC,GAAGC,UAAW,CACxCJ,cAAeA,cACfK,cAAeA,cACfgB,kBAAmBA,kBACnBD,iBAAkBA,iBAClBY,iBAAkBA,iBAClBE,yBAA0BA,yBAC1B5B,gBAAiBA,gBACjBwC,sBAAuBA,uBAG9B,EA7QD,CA6QGpD,QAQAG,OAJCH,OAAOyE,UAAUC,KAAK,mBAAmB,WACrCxE,GAAGM,OAAOC,GAAGC,UAAUJ,eAC3B","ignoreList":[],"sourcesContent":["/* Portal Re-Usable Slidepane */\r\n\r\n(function (jQuery, undefined) {\r\n var sm = window.sm = window.sm || {};\r\n var windowProxy;\r\n var actionQueue = [];\r\n\r\n if (typeof sm.portal === \"undefined\") {\r\n jQuery.extend(sm, { portal: {} });\r\n }\r\n if (typeof sm.portal.ui === \"undefined\") {\r\n jQuery.extend(sm.portal, { ui: {} });\r\n }\r\n if (typeof sm.portal.ui.slidepane === \"undefined\") {\r\n jQuery.extend(sm.portal.ui, { slidepane: {} });\r\n }\r\n\r\n function initSlidepane() {\r\n unobtrusiveSlidepaneWiring();\r\n }\r\n\r\n function unobtrusiveSlidepaneWiring() {\r\n sm.portal.ui.slidepane.stickySlideup();\r\n sm.portal.ui.slidepane.slidepaneResize();\r\n }\r\n\r\n /* SLIDEUP FUNCTION */\r\n function stickySlideup() {\r\n // wire button\r\n jQuery('[data-activate-slideup]').not('[data-processed=\"true\"]').each(function () {\r\n var that = jQuery(this);\r\n var $mySlideup = jQuery('#' + that.attr('data-activate-slideup'));\r\n\r\n\r\n var opencb = that.is('[data-after-slide-up]') ? that.attr('data-after-slide-up') : null;\r\n var openargs = that.is('[data-after-slide-up-args]') ? that.attr('data-after-slide-up-args') : null;\r\n var closecb = that.is('[data-after-slide-down]') ? that.attr('data-after-slide-down') : null;\r\n var closeargs = that.is('[data-after-slide-down-args]') ? that.attr('data-after-slide-down-args') : null;\r\n\r\n that.on('click', function () {\r\n if (!that.hasClass('active')) {\r\n sm.portal.ui.slidepane.openStickySlideup($mySlideup, opencb, openargs); \r\n }\r\n else {\r\n sm.portal.ui.slidepane.closeThisSlideup($mySlideup, closecb, closeargs);\r\n }\r\n })\r\n that.attr('data-processed', true);\r\n });\r\n\r\n // wire close\r\n jQuery('[data-close-slideup]').not('[data-processed=\"true\"]').each(function () {\r\n var that = jQuery(this);\r\n var mySlideup = jQuery('#' + that.attr('data-close-slideup'));\r\n \r\n that.on('click', function () {\r\n sm.portal.ui.slidepane.closeThisSlideup(mySlideup);\r\n });\r\n that.attr('data-processed', true);\r\n });\r\n }\r\n\r\n function openStickySlideup(slideup, cb, args) {\r\n if (!sm.portal.utility.isNullOrEmpty(slideup)) {\r\n var relatedButton = jQuery('[data-activate-slideup=\"' + slideup.attr('id') + '\"]');\r\n var transitionEnded = sm.portal.utility.whichTransitionEvent();\r\n\r\n // activate related button (if applicable)\r\n if (!sm.portal.utility.isNullOrEmpty(relatedButton) && !relatedButton.hasClass('active')) {\r\n relatedButton.addClass('active');\r\n }\r\n\r\n // close other slideups\r\n sm.portal.ui.slidepane.closeAllSlideups();\r\n\r\n // make it visible\r\n slideup.removeClass('hidden').addClass('visible');\r\n\r\n // position slideup\r\n sm.portal.ui.slidepane.fixStickySlideupPosition();\r\n\r\n // grow height per css\r\n slideup.addClass('inYourFace');\r\n\r\n // disable all slideup control buttons until animation is done - otherwise could end up in a weird state\r\n jQuery('[data-activate-slideup]').not('[disabled]').attr('disabled', 'disabled').attr('data-temp-disabled', true);\r\n\r\n var transitionEndFired = false;\r\n slideup.one(transitionEnded, function () {\r\n transitionEndFired = openSlideupInternal(transitionEndFired, cb, args);\r\n //console.log('Backside event fired'); // Great debugging flag\r\n });\r\n\r\n setTimeout(function () {\r\n transitionEndFired = openSlideupInternal(transitionEndFired, cb, args);\r\n //console.log('Backside timeout fired'); // Great debugging flag\r\n jQuery(slideup).modalTabbing();\r\n }, 300);\r\n }\r\n }\r\n\r\n function closeThisSlideup(slideup, cb, args) {\r\n\r\n var transitionEnded = sm.portal.utility.whichTransitionEvent();\r\n var originalPosition = jQuery('[data-original-position]').attr('data-original-position');\r\n\r\n // if we don't have a valid slideup ID passed in, logically hide the only showing one\r\n if (typeof slideup[0] == \"undefined\") {\r\n slideup = jQuery('#' + jQuery('.smStickySlideup.inYourFace.visible').attr('id'));\r\n }\r\n\r\n // Deactivate related button\r\n var relatedButton = jQuery('[data-activate-slideup=\"' + slideup.attr('id') + '\"]');\r\n if (!sm.portal.utility.isNullOrEmpty(relatedButton)) {\r\n relatedButton.removeClass('active');\r\n }\r\n\r\n // disable all slideup control buttons until animation is done - otherwise could end up in a weird state\r\n jQuery('[data-activate-slideup]').not('[disabled]').attr('disabled', 'disabled').attr('data-temp-disabled', true);\r\n slideup.removeClass('inYourFace');\r\n\r\n // Transition End handlers\r\n var transitionEndFired = false;\r\n slideup.one(transitionEnded, function () {\r\n transitionEndFired = closeSlideupInternal(slideup, transitionEndFired, originalPosition);\r\n //console.log('Backside event fired'); // Great debugging flag\r\n });\r\n\r\n // Edge versions aren't always firing the TransitionEnd event properly, so this is to catch those situations.\r\n setTimeout(function () {\r\n transitionEndFired = closeSlideupInternal(slideup, transitionEndFired, originalPosition);\r\n //console.log('Backside timeout fired'); // Great debugging flag\r\n if (!sm.portal.utility.isNullOrEmpty(relatedButton) && !relatedButton.hasClass('active')) {\r\n relatedButton.focus();\r\n }\r\n }, 300);\r\n }\r\n\r\n function closeAllSlideups(cb, args) {\r\n var visibleSlideups = jQuery('.smStickySlideup.visible.inYourFace');\r\n var transitionEnded = sm.portal.utility.whichTransitionEvent();\r\n\r\n visibleSlideups.each(function () {\r\n var that = jQuery(this);\r\n var relatedButton = jQuery('[data-activate-slideup=\"' + that.attr('id') + '\"]');\r\n if (!sm.portal.utility.isNullOrEmpty(relatedButton)) {\r\n relatedButton.removeClass('active');\r\n }\r\n\r\n // disable all slideup control buttons until animation is done - otherwise could end up in a weird state\r\n jQuery('[data-activate-slideup]').not('[disabled]').attr('disabled', 'disabled').attr('data-temp-disabled', true);\r\n\r\n that.removeClass('inYourFace');\r\n\r\n var transitionEndFired = false;\r\n\r\n that.one(transitionEnded, function () {\r\n transitionEndFired = closeSlideupInternal(that, transitionEndFired, null, cb, args); 23\r\n //console.log('Backside Event fired'); // Great debugging flag\r\n });\r\n\r\n // Edge versions aren't always firing the TransitionEnd event properly, so this is to catch those situations.\r\n setTimeout(function () {\r\n transitionEndFired = closeSlideupInternal(that, transitionEndFired, null, cb, args);\r\n //console.log('Backside timeout fired'); // Great debugging flag\r\n }, 300);\r\n });\r\n }\r\n\r\n // Handles the opening action of sticky footer slideup for Edge event-firing issues\r\n function openSlideupInternal(transitionEndFired, cb, args) {\r\n if (!transitionEndFired) {\r\n\r\n transitionEndFired = true;\r\n\r\n sm.portal.theme.freezeContent();\r\n sm.portal.ui.slidepane.slideupContentHeights();\r\n\r\n // re-enable buttons\r\n jQuery('[data-activate-slideup][data-temp-disabled]').removeAttr('disabled').removeAttr('data-temp-disabled');\r\n\r\n // handle callback\r\n sm.portal.ui.executeFunctionByName(cb, window, args);\r\n }\r\n return transitionEndFired;\r\n }\r\n\r\n // Handles the closing action of sticky footer slideup for Edge event-firing issues\r\n function closeSlideupInternal(slideup, transitionEndFired, originalPosition, cb, args) {\r\n\r\n if (!transitionEndFired) {\r\n\r\n transitionEndFired = true;\r\n\r\n // after it lowers - make it invisible again\r\n slideup.removeClass('visible').addClass('hidden');\r\n\r\n // re-enable buttons\r\n jQuery('[data-activate-slideup][data-temp-disabled]').removeAttr('disabled').removeAttr('data-temp-disabled');\r\n\r\n // Toggle this one\r\n sm.portal.theme.unfreezeContent(originalPosition);\r\n\r\n // remove data-original-position\r\n jQuery('body').removeAttr('data-original-position');\r\n\r\n // process callbacks if present\r\n if (!sm.portal.utility.isNullOrEmpty(cb) && typeof cb === 'function') {\r\n eval(cb(args));\r\n } \r\n }\r\n return transitionEndFired;\r\n }\r\n\r\n // Manages Positioning of Sticky Footer When Responsive\r\n function fixStickySlideupPosition() {\r\n var footerButtonsHeight = jQuery('.smStickyFooterButtons').outerHeight(true);\r\n jQuery('.smStickySlideup').css('bottom', footerButtonsHeight + 'px');\r\n }\r\n\r\n // Adds height to course lists (looks for areas marked data-to-bottom) - for scrolling content\r\n function slideupContentHeights() {\r\n var activeSlideup = jQuery('.smStickySlideup.inYourFace');\r\n var totalHeight = jQuery(window).innerHeight();\r\n var headerToExclude = activeSlideup.find('.smSlideupHeader');\r\n var whichScenario = activeSlideup.children('div:visible').attr('class');\r\n var sliderContentHeight = activeSlideup.find('[data-to-bottom]'); /* USE THIS ATTRIBUTE TO SPECIFY WHAT AREA SHOULD BE SCROLLABLE */\r\n var exclusionHeight;\r\n // accommodate various cart scenarios\r\n\r\n switch (whichScenario) {\r\n case 'smCoursesCart':\r\n var checkoutFooterToExclude = activeSlideup.find('.cartCheckout').outerHeight(true);// includes margins\r\n exclusionHeight = headerToExclude.outerHeight(true) + jQuery('.smStickyFooterButtons').outerHeight(true) + checkoutFooterToExclude + 10;\r\n break;\r\n\r\n case 'smLoginRegister':\r\n exclusionHeight = headerToExclude.outerHeight(true) + jQuery('.smStickyFooterButtons').outerHeight(true) + 60;\r\n break;\r\n\r\n case 'smPaymentForm':\r\n exclusionHeight = headerToExclude.outerHeight(true) + jQuery('.smStickyFooterButtons').outerHeight(true) + 65;\r\n break;\r\n\r\n case 'smProcessingConfirmation':\r\n exclusionHeight = headerToExclude.outerHeight(true) + jQuery('.smStickyFooterButtons').outerHeight(true) + 65;\r\n }\r\n\r\n // cart items height\r\n sliderContentHeight.height(totalHeight - exclusionHeight + 'px');\r\n }\r\n\r\n function slidepaneResize() {\r\n jQuery(window).onDelayed('resize', 100, function () {\r\n sm.portal.ui.slidepane.fixStickySlideupPosition();\r\n sm.portal.ui.slidepane.slideupContentHeights();\r\n });\r\n }\r\n\r\n\r\n jQuery.extend(true, sm.portal.ui.slidepane, {\r\n initSlidepane: initSlidepane,\r\n stickySlideup: stickySlideup,\r\n openStickySlideup: openStickySlideup,\r\n closeThisSlideup: closeThisSlideup,\r\n closeAllSlideups: closeAllSlideups,\r\n fixStickySlideupPosition: fixStickySlideupPosition,\r\n slidepaneResize: slidepaneResize,\r\n slideupContentHeights: slideupContentHeights\r\n });\r\n\r\n})(jQuery);\r\n\r\n(function (window, undefined) {\r\n\r\n jQuery(document).bind('afterSMInitPage', function () {\r\n sm.portal.ui.slidepane.initSlidepane();\r\n });\r\n\r\n})(window);\r\n\r\n"]}