{"version":3,"file":"jquery.sticky-kit.min.js","sources":["vendor/jquery.sticky-kit.min.js"],"sourcesContent":["\"use strict\";\n\n(function ($) {\n // Generated by CoffeeScript 1.9.2\n\n /**\n @license Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net\n */\n\n (function () {\n var win;\n win = $(window);\n $.fn.stick_in_parent = function (opts) {\n var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, parent_selector, recalc_every, sticky_class;\n if (opts == null) {\n opts = {};\n }\n sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming;\n if (offset_top == null) {\n offset_top = 0;\n }\n if (parent_selector == null) {\n parent_selector = void 0;\n }\n if (inner_scrolling == null) {\n inner_scrolling = true;\n }\n if (sticky_class == null) {\n sticky_class = \"is_stuck\";\n }\n doc = $(document);\n if (enable_bottoming == null) {\n enable_bottoming = true;\n }\n fn = function fn(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) {\n var bottomed, _detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;\n if (elm.data(\"sticky_kit\")) {\n return;\n }\n elm.data(\"sticky_kit\", true);\n last_scroll_height = doc.height();\n parent = elm.parent();\n if (parent_selector != null) {\n parent = parent.closest(parent_selector);\n }\n if (!parent.length) {\n throw \"failed to find stick parent\";\n }\n fixed = false;\n bottomed = false;\n spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $(\"
\");\n if (spacer) {\n spacer.css('position', elm.css('position'));\n }\n recalc = function recalc() {\n var border_top, padding_top, restore;\n if (detached) {\n return;\n }\n last_scroll_height = doc.height();\n border_top = parseInt(parent.css(\"border-top-width\"), 10);\n padding_top = parseInt(parent.css(\"padding-top\"), 10);\n padding_bottom = parseInt(parent.css(\"padding-bottom\"), 10);\n parent_top = parent.offset().top + border_top + padding_top;\n parent_height = parent.height();\n if (fixed) {\n fixed = false;\n bottomed = false;\n if (manual_spacer == null) {\n elm.insertAfter(spacer);\n spacer.detach();\n }\n elm.css({\n position: \"\",\n top: \"\",\n width: \"\",\n bottom: \"\"\n }).removeClass(sticky_class);\n restore = true;\n }\n top = elm.offset().top - (parseInt(elm.css(\"margin-top\"), 10) || 0) - offset_top;\n height = elm.outerHeight(true);\n el_float = elm.css(\"float\");\n if (spacer) {\n spacer.css({\n width: elm.outerWidth(true),\n height: height,\n display: elm.css(\"display\"),\n \"vertical-align\": elm.css(\"vertical-align\"),\n \"float\": el_float\n });\n }\n if (restore) {\n return tick();\n }\n };\n recalc();\n if (height === parent_height) {\n return;\n }\n last_pos = void 0;\n offset = offset_top;\n recalc_counter = recalc_every;\n tick = function tick() {\n var css, delta, recalced, scroll, will_bottom, win_height;\n if (detached) {\n return;\n }\n recalced = false;\n if (recalc_counter != null) {\n recalc_counter -= 1;\n if (recalc_counter <= 0) {\n recalc_counter = recalc_every;\n recalc();\n recalced = true;\n }\n }\n if (!recalced && doc.height() !== last_scroll_height) {\n recalc();\n recalced = true;\n }\n scroll = win.scrollTop();\n if (last_pos != null) {\n delta = scroll - last_pos;\n }\n last_pos = scroll;\n if (fixed) {\n if (enable_bottoming) {\n will_bottom = scroll + height + offset > parent_height + parent_top;\n if (bottomed && !will_bottom) {\n bottomed = false;\n elm.css({\n position: \"fixed\",\n bottom: \"\",\n top: offset\n }).trigger(\"sticky_kit:unbottom\");\n }\n }\n if (scroll < top) {\n fixed = false;\n offset = offset_top;\n if (manual_spacer == null) {\n if (el_float === \"left\" || el_float === \"right\") {\n elm.insertAfter(spacer);\n }\n spacer.detach();\n }\n css = {\n position: \"\",\n width: \"\",\n top: \"\"\n };\n elm.css(css).removeClass(sticky_class).trigger(\"sticky_kit:unstick\");\n }\n if (inner_scrolling) {\n win_height = win.height();\n if (height + offset_top > win_height) {\n if (!bottomed) {\n offset -= delta;\n offset = Math.max(win_height - height, offset);\n offset = Math.min(offset_top, offset);\n if (fixed) {\n elm.css({\n top: offset + \"px\"\n });\n }\n }\n }\n }\n } else {\n if (scroll > top) {\n fixed = true;\n css = {\n position: \"fixed\",\n top: offset\n };\n css.width = elm.css(\"box-sizing\") === \"border-box\" ? elm.outerWidth() + \"px\" : elm.width() + \"px\";\n elm.css(css).addClass(sticky_class);\n if (manual_spacer == null) {\n elm.after(spacer);\n if (el_float === \"left\" || el_float === \"right\") {\n spacer.append(elm);\n }\n }\n elm.trigger(\"sticky_kit:stick\");\n }\n }\n if (fixed && enable_bottoming) {\n if (will_bottom == null) {\n will_bottom = scroll + height + offset > parent_height + parent_top;\n }\n if (!bottomed && will_bottom) {\n bottomed = true;\n if (parent.css(\"position\") === \"static\") {\n parent.css({\n position: \"relative\"\n });\n }\n return elm.css({\n position: \"absolute\",\n bottom: padding_bottom,\n top: \"auto\"\n }).trigger(\"sticky_kit:bottom\");\n }\n }\n };\n recalc_and_tick = function recalc_and_tick() {\n recalc();\n return tick();\n };\n _detach = function detach() {\n detached = true;\n win.off(\"touchmove\", tick);\n win.off(\"scroll\", tick);\n win.off(\"resize\", recalc_and_tick);\n $(document.body).off(\"sticky_kit:recalc\", recalc_and_tick);\n elm.off(\"sticky_kit:detach\", _detach);\n elm.removeData(\"sticky_kit\");\n elm.css({\n position: \"\",\n bottom: \"\",\n top: \"\",\n width: \"\"\n });\n parent.position(\"position\", \"\");\n if (fixed) {\n if (manual_spacer == null) {\n if (el_float === \"left\" || el_float === \"right\") {\n elm.insertAfter(spacer);\n }\n spacer.remove();\n }\n return elm.removeClass(sticky_class);\n }\n };\n win.on(\"touchmove\", tick);\n win.on(\"scroll\", tick);\n win.on(\"resize\", recalc_and_tick);\n $(document.body).on(\"sticky_kit:recalc\", recalc_and_tick);\n elm.on(\"sticky_kit:detach\", _detach);\n return setTimeout(tick, 0);\n };\n for (i = 0, len = this.length; i < len; i++) {\n elm = this[i];\n fn($(elm));\n }\n return this;\n };\n }).call(this);\n})(jQuery);"],"names":["$","win","window","fn","stick_in_parent","opts","doc","elm","i","len","sticky_class","inner_scrolling","recalc_every","parent_selector","parent","offset_top","manual_spacer","spacer","enable_bottoming","bottoming","document","padding_bottom","parent_top","parent_height","top","height","el_float","detached","bottomed","_detach","fixed","last_pos","last_scroll_height","offset","recalc","recalc_and_tick","recalc_counter","tick","data","closest","length","css","border_top","padding_top","restore","parseInt","insertAfter","detach","position","width","bottom","removeClass","outerHeight","outerWidth","display","vertical-align","float","delta","scroll","will_bottom","win_height","recalced","scrollTop","trigger","Math","max","min","addClass","after","append","off","body","removeData","remove","on","setTimeout","this","call","jQuery"],"mappings":"AAEA,CAAA,SAAWA,GAOT,CAAA,WACE,IACAC,EAAMD,EAAEE,MAAM,EACdF,EAAEG,GAAGC,gBAAkB,SAAUC,GAC/B,IAAIC,EAAKC,EAAuBJ,EAAIK,EAAoBC,EAIxDC,GAFEL,EADU,MAARA,EACK,GAEMA,GAAKK,aAAcC,EAAkBN,EAAKM,gBAAiBC,EAAeP,EAAKO,aAAcC,EAAkBR,EAAKS,OAAQC,EAAaV,EAAKU,WAAYC,EAAgBX,EAAKY,OAAQC,EAAmBb,EAAKc,UAiO9N,IAhOkB,MAAdJ,IACFA,EAAa,GAEQ,MAAnBF,IACFA,EAAkB,KAAA,GAEG,MAAnBF,IACFA,EAAkB,CAAA,GAEA,MAAhBD,IACFA,EAAe,YAEjBJ,EAAMN,EAAEoB,QAAQ,EACQ,MAApBF,IACFA,EAAmB,CAAA,GAErBf,EAAK,SAAYI,EAAKc,EAAgBC,EAAYC,EAAeC,EAAKC,EAAQC,EAAUC,GACtF,IAAIC,EAAUC,EAASC,EAAOC,EAAUC,EAAoBC,EAAQnB,EAAQoB,EAAQC,EAAiBC,EAAgBnB,EAAQoB,EAC7H,GAAI9B,CAAAA,EAAI+B,KAAK,YAAY,EAAzB,CASA,GANA/B,EAAI+B,KAAK,aAAc,CAAA,CAAI,EAC3BN,EAAqB1B,EAAImB,OAAO,EAChCX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