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G;gCAClG,2FAA2F;gCAC3F,SAAS,KAAK,GAAG,QAAQ,CAAC,mBAAmB,WAAW,CAAC,UAAU,GAAG,CAAC,cAAc;gCACrF,SAAS,IAAI,CAAC,oBAAoB,MAAM;gCAExC,oEAAoE;gCACpE,sDAAsD;gCACtD,SAAS,IAAI,CAAC,sBAAsB,SAAS,IAAI,CAAC,UAAU,QAAQ,CAAC,OAAO,QAAQ,CAAC,UAAU;gCAE/F,4DAA4D;gCAC5D,IAAI,OAAO,QAAQ,CAAC,KAAK,IAAI,OAAO,OAAO,QAAQ,CAAC,KAAK,KAAK,YAE1D,uFAAuF;gCACvF,wFAAwF;gCACxF,wBAAwB;gCACxB,OAAO,QAAQ,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,OAAO,QAAQ,CAAC,WAAW,EAAE,UAAU;4BAElF;4BAEA,+BAA+B;4BAC/B,SAAS,GAAG,CAAC;gCAET,UAAY;gCACZ,MAAY,SAAS,IAAI;gCACzB,KAAY,mBAAmB,SAAS,OAAO,QAAQ,CAAC,cAAc,GAAG,OAAO,QAAQ,CAAC,cAAc;4BAG3G,GAAG,QAAQ,CAAC;wBAEhB;oBAEJ;oBAEA,gEAAgE;oBAChE,QAAQ,OAAO,CAAC,WAAW;gBAE/B;YAEJ;QAEJ;QAEA,OAAO,QAAQ,GAAG,CAAC;QAEnB,aAAa;QACb;IAEJ;AAEJ,CAAA,EAAG,QAAQ,QAAQ","sources":["src/110_menus/main/zebra_pin.src.js"],"sourcesContent":["/**\n * Zebra_Pin\n *\n * Zebra_Pin is a lightweight (2.5KB minified, ~800 bytes gzipped) and adaptive (things work as expected when the browser\n * window is resized) jQuery plugin for pinning elements to the page or to a container element, so that pinned elements\n * remain visible when they are about to be scrolled out of view. This type of elements are also referred to as \"fixed\n * position elements\" or \"sticky elements\".\n *\n * Use it to create sticky sidebars, sticky navigation, sticky headers and footers, or anything else you feel the need\n * to make it stick to the page while the user scrolls.\n *\n * You can have \"hard\" pinned elements - elements are pinned to their initial position and stay there, elements that\n * become pinned when they are about to be scrolled out of view, as well as pinned elements that can move only inside\n * their parent element's boundaries.\n *\n * Pinned elements are added a user-defined CSS class so you can adjust their looks when pinned. Additionally, custom\n * events are fired when elements become pinned/unpinned giving you even more power for customizing the result.\n *\n * Works in pretty much any browser - Firefox, Chrome, Safari, Edge, Opera and Internet Explorer 7+\n *\n * Read more {@link https://github.com/stefangabos/Zebra_Pin/ here}\n *\n * @author Stefan Gabos \n * @version 2.0.0 (last revision: July 20, 2018)\n * @copyright (c) 2013 - 2018 Stefan Gabos\n * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LESSER GENERAL PUBLIC LICENSE\n * @package Zebra_Pin\n */\n(function($) {\n\n 'use strict';\n\n $.Zebra_Pin = function(elements, options) {\n\n // so you can tell the version number even if all you have is the minified source\n this.version = '2.0.0';\n\n var defaults = {\n\n // class to add to the element when it is becomes pinned\n class_name: 'Zebra_Pin',\n\n // specifies whether the pinned element should be restricted to its parent element's boundaries or not.\n //\n // default is FALSE\n contain: false,\n\n // specifies whether the element should be \"hard\" pinned (pinned to its position from the beginning), or\n // become pinned only when it is about to go out of view.\n //\n // default is FALSE\n hard: false,\n\n // distance, in pixels, from the browser window's top (or the container element's top, when element is\n // contained to its parent element's boundaries) from which the element should become pinned.\n // this only works if the \"hard\" property is set to FALSE.\n //\n // default is 0\n top_spacing: 0,\n\n // distance, in pixels, from the containing parent element's bottom which the pinned element must not\n // exceed.\n // this only works if the \"hard\" property is set to FALSE and the \"contain\" property is set to TRUE\n //\n // default is 0\n bottom_spacing: 0,\n\n // the value of zIndex CSS property to be set for pinned elements\n // default is 1000\n z_index: 1000,\n\n // callback function to be executed when an element becomes pinned\n // the callback function receives 3 arguments:\n // - the vertical position, relative to the document, where the event occurred\n // - a reference to the pinned element\n // - the index of the element - if the plugin was attached to multiple elements (0 based)\n onPin: null,\n\n // callback function to be executed when an element becomes unpinned (reverts to its original state)\n // the callback function receives 3 arguments:\n // - the vertical position, relative to the document, where the event occurred\n // - a reference to the unpinned element\n // - the index of the element - if the plugin was attached to multiple elements (0 based)\n onUnpin: null\n\n },\n\n // to avoid confusions, we use \"plugin\" to reference the current instance of the object\n plugin = this,\n\n // generate a unique id to use for easily binding/unbinding events and not interfere with other instances of the plugin\n uniqueid = (Math.random() + 1).toString(36).substring(2, 7),\n\n // reference to the window element\n $window = $(window),\n\n /**\n * Constructor method. Initializes the plugin.\n *\n * @return void\n */\n _init = function() {\n\n // the plugin's final properties are the merged default and\n // user-provided options (if any)\n plugin.settings = $.extend({}, defaults, options);\n\n // update elements' position\n plugin.update();\n\n // on window resize\n $window.on('resize', function() {\n\n // update elements' position\n plugin.update();\n\n });\n\n };\n\n /**\n * Updates the pinned elements' positions in accordance with the scrolled amount and with the pinned elements'\n * container elements (if any).\n *\n * Useful if a pinned element's parent changes height.\n *\n * \n * // initialize the plugin\n * var zp = new Zebra_Pin($('#my_pinned_element'), {\n * // element can move only inside\n * // the parent element\n * 'contain': true\n * });\n *\n * // if the parent element's height changes\n * // update also the boundaries\n * zp.update();\n * \n *\n * @return void\n */\n plugin.update = function() {\n\n // iterate through elements that need to be pinned\n elements.each(function(index) {\n\n // reference to the current element\n var $element = $(this);\n\n // if the element is already pinned\n if ($(this).hasClass(plugin.settings.class_name)) {\n\n // reset the element's default properties\n $element.attr('style', $element.data('ztt_previous_style') || '').removeClass(plugin.settings.class_name).removeClass('Zebra_Pin_Contained');\n\n // remove the clone element, if it exists\n $element.next('.Zebra_Pin_Clone').remove();\n\n }\n\n var\n\n // get the element's position relative to the document\n offset = $element.offset(),\n\n // get the element's position relative to the parent element\n position = $element.position(),\n\n // get the element's height, including padding and border\n height = $element.outerHeight(),\n\n // get the element's width, including padding and border\n width = $element.outerWidth(),\n\n // get margins, if any; we need this because position() takes margins into account while offset()\n // doesn't and so we need to compensate\n // see http://bugs.jquery.com/ticket/11606\n margin_left = (parseInt($element.css('marginLeft'), 10) || 0),\n margin_top = (parseInt($element.css('marginTop'), 10) || 0),\n\n // we'll use these later on, if the pinned element needs to be contained in the parent element\n $container, container_height, container_offset,\n\n proxy;\n\n // adjust offset with margins\n offset.left -= margin_left;\n offset.top -= margin_top;\n\n // if element needs to be contained inside the parent element's boundaries\n if (plugin.settings.contain) {\n\n // reference to the parent element\n $container = $element.parent();\n\n // get parent element's height\n container_height = $container.height();\n\n // get parent element's position relative to the document\n container_offset = $container.offset();\n\n }\n\n // if element is \"hard\" pinned (the element is pinned to its position from the beginning)\n if (plugin.settings.hard)\n\n // set element's CSS properties\n $element.css({\n\n position: 'fixed',\n left: offset.left,\n top: offset.top,\n width: width,\n zIndex: plugin.settings.z_index\n\n // add a class indicating that the element is pinned\n }).addClass(plugin.settings.class_name);\n\n // if element is not \"hard\" pinned\n else {\n\n // we generate a unique namespace for each element of each instance of the plugin\n // we do this so that we can easily unbind them without affecting other elements\n // and instances of the plugin\n proxy = '.Zebra_Pin_' + uniqueid + '_' + index;\n\n // unbind a previously set handler and attach a new one\n $window.off('scroll' + proxy).on('scroll' + proxy, function() {\n\n // get scrolled amount\n var scroll = $window.scrollTop();\n\n // if\n if (\n\n // the user scrolled past the element's top (minus \"top_spacing\")\n scroll >= offset.top - plugin.settings.top_spacing &&\n\n // AND\n (\n\n // the element is not \"contained\"\n !plugin.settings.contain ||\n\n // OR the element is contained but its bottom didn't reach the container's bottom\n (scroll <= container_offset.top + container_height - plugin.settings.top_spacing - height - plugin.settings.bottom_spacing)\n\n // AND\n ) && (\n\n // the element does not have the class indicating that it is pinned\n !$element.hasClass(plugin.settings.class_name) ||\n\n // OR the element has the class indicating that it is pinned, but it also contains the\n // \"Zebra_Pin_Contained\" meaning that the user is now scrolling upwards and that the\n // element's bottom is *not* touching its container's bottom anymore\n $element.hasClass('Zebra_Pin_Contained')\n\n )\n\n ) {\n\n // if element is *not* contained and at the bottom of its container\n if (!$element.hasClass('Zebra_Pin_Contained')) {\n\n // create a clone of the element, insert it right after the original element and make it invisible\n // we do this so that we don't break the layout by removing the pinned element from the DOM\n $element.clone().addClass('Zebra_Pin_Clone').insertAfter($element).css('visibility', 'hidden');\n\n // save the element's \"style\" attribute as we are going to modify it\n // and add class indicating that the element is pinned\n $element.data('ztt_previous_style', $element.attr('style')).addClass(plugin.settings.class_name);\n\n // if a callback function exists for when pinning an element\n if (plugin.settings.onPin && typeof plugin.settings.onPin === 'function')\n\n // execute the callback function and pass as arguments the scrolled amount, the element\n // the plugin is attached to, and the index of the element from the list of elements the\n // plugin is attached to\n plugin.settings.onPin(offset.top - plugin.settings.top_spacing, $element, index);\n\n // if the user is now scrolling upwards and a \"contained\" element's bottom is *not* touching\n // its container's bottom anymore\n } else\n\n // remove this class\n $element.removeClass('Zebra_Pin_Contained');\n\n // set the element's CSS properties\n $element.css({\n position: 'fixed',\n left: offset.left,\n top: plugin.settings.top_spacing,\n width: width,\n zIndex: plugin.settings.z_index\n });\n\n // else if\n } else if (\n\n // the user scrolled up past the element's top (minus \"top_spacing\")\n scroll < offset.top - plugin.settings.top_spacing &&\n\n // and the element was pinned\n $element.hasClass(plugin.settings.class_name)\n\n ) {\n\n // remove the clone element\n $element.next('.Zebra_Pin_Clone').remove();\n\n // reset the element's original \"style\" attribute and remove the class indicating that the element is pinned\n $element.attr('style', $element.data('ztt_previous_style') || '').removeClass(plugin.settings.class_name);\n\n // if a callback function exists for when unpinning an element\n if (plugin.settings.onUnpin && typeof plugin.settings.onUnpin === 'function')\n\n // execute the callback function and pass as arguments the scrolled amount, the element\n // the plugin is attached to, and the index of the element from the list of elements the\n // plugin is attached to\n plugin.settings.onUnpin(offset.top - plugin.settings.top_spacing, $element, index);\n\n // else if\n } else if (\n\n // the element needs to be contained inside the parent element's boundaries\n plugin.settings.contain &&\n\n // the user scrolled past the container element's bottom\n scroll >= container_offset.top + container_height - plugin.settings.top_spacing - height - plugin.settings.bottom_spacing &&\n\n // the element is missing the class indicating that it reached the container element's bottom\n !$element.hasClass('Zebra_Pin_Contained')\n\n ) {\n\n // if we didn't have the chance to initialize the pin\n // (when the page doesn't start at the top)\n if (!$element.hasClass(plugin.settings.class_name)) {\n\n // create a clone of the element, insert it right after the original element and make it invisible\n // we do this so that we don't break the layout by removing the pinned element from the DOM\n $element.clone().addClass('Zebra_Pin_Clone').insertAfter($element).css('visibility', 'hidden');\n $element.next('.Zebra_Pin_Clone').remove();\n\n // save the element's \"style\" attribute as we are going to modify it\n // and add class indicating that the element is pinned\n $element.data('ztt_previous_style', $element.attr('style')).addClass(plugin.settings.class_name);\n\n // if a callback function exists for when pinning an element\n if (plugin.settings.onPin && typeof plugin.settings.onPin === 'function')\n\n // execute the callback function and pass as arguments the scrolled amount, the element\n // the plugin is attached to, and the index of the element from the list of elements the\n // plugin is attached to\n plugin.settings.onPin(offset.top - plugin.settings.top_spacing, $element, index);\n\n }\n\n // set element's CSS properties\n $element.css({\n\n position: 'absolute',\n left: position.left,\n top: container_height - height - plugin.settings.bottom_spacing - plugin.settings.bottom_spacing\n\n // add a class indicating that the element reached the container element's bottom\n }).addClass('Zebra_Pin_Contained');\n\n }\n\n });\n\n // trigger the scroll event so that the computations take effect\n $window.trigger('scroll' + proxy);\n\n }\n\n });\n\n };\n\n plugin.settings = {};\n\n // off we go!\n _init();\n\n };\n\n})(jQuery, window, document);\n"],"names":[],"version":3,"file":"zebra_pin.src.js.map"}