/*!
* myStickysidebar
* v1.2.3
*/
(function( $ ) {
'use strict';
$(function() {
if ( jQuery.browser.mobile && !mystickyside_name.device_mobile) {
return false;
} else if ( !jQuery.browser.mobile && !mystickyside_name.device_desktop) {
return false;
}
var mysticky_sidebar_id = document.querySelector(mystickyside_name.mystickyside_string),
mystickyside_content_id = (mystickyside_name.mystickyside_content_string),
mystickyside_margin_top = parseInt(mystickyside_name.mystickyside_margin_top_string),
mystickyside_margin_bot = parseInt(mystickyside_name.mystickyside_margin_bot_string),
mystickyside_update_sidebar_height = Boolean(mystickyside_name.mystickyside_update_sidebar_height_string),
mystickyside_min_width = parseInt(mystickyside_name.mystickyside_min_width_string);
$(mysticky_sidebar_id).theiaStickySidebar({
containerSelector: mystickyside_content_id,
additionalMarginTop: mystickyside_margin_top,
additionalMarginBottom: mystickyside_margin_bot,
updateSidebarHeight: mystickyside_update_sidebar_height,
minWidth: mystickyside_min_width
});
});
})( jQuery );
/*!
* Theia Sticky Sidebar v1.7.0
* https://github.com/WeCodePixels/theia-sticky-sidebar
*
* Glues your website's sidebars, making them permanently visible while scrolling.
*
* Copyright 2013-2016 WeCodePixels and other contributors
* Released under the MIT license
*/
(function ($) {
$.fn.theiaStickySidebar = function (options) {
var defaults = {
'containerSelector': '',
'additionalMarginTop': 0,
'additionalMarginBottom': 0,
'updateSidebarHeight': true,
'minWidth': 0,
'disableOnResponsiveLayouts': true,
'sidebarBehavior': 'modern',
'defaultPosition': 'relative',
'namespace': 'TSS'
};
options = $.extend(defaults, options);
// Validate options
options.additionalMarginTop = parseInt(options.additionalMarginTop) || 0;
options.additionalMarginBottom = parseInt(options.additionalMarginBottom) || 0;
tryInitOrHookIntoEvents(options, this);
// Try doing init, otherwise hook into window.resize and document.scroll and try again then.
function tryInitOrHookIntoEvents(options, $that) {
var success = tryInit(options, $that);
if (!success) {
console.log('TSS: Body width smaller than options.minWidth. Init is delayed.');
$(document).on('scroll.' + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt);
}
};
}(options, $that));
$(window).on('resize.' + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt);
}
};
}(options, $that))
}
}
// Try doing init if proper conditions are met.
function tryInit(options, $that) {
if (options.initialized === true) {
return true;
}
if ($('body').width() < options.minWidth) {
return false;
}
init(options, $that);
return true;
}
// Init the sticky sidebar(s).
function init(options, $that) {
options.initialized = true;
// Add CSS
var existingStylesheet = $('#theia-sticky-sidebar-stylesheet-' + options.namespace);
if (existingStylesheet.length === 0) {
$('head').append($(''));
}
$that.each(function () {
var o = {};
o.sidebar = $(this);
// Save options
o.options = options || {};
// Get container
o.container = $(o.options.containerSelector);
if (o.container.length == 0) {
o.container = o.sidebar.parent();
}
// Create sticky sidebar
// o.sidebar.parents().css('-webkit-transform', 'none'); // Fix for WebKit bug - https://code.google.com/p/chromium/issues/detail?id=20574
o.sidebar.css({
'position': o.options.defaultPosition,
'overflow': 'visible',
// The "box-sizing" must be set to "content-box" because we set a fixed height to this element when the sticky sidebar has a fixed position.
'-webkit-box-sizing': 'border-box',
'-moz-box-sizing': 'border-box',
'box-sizing': 'border-box'
});
// Get the sticky sidebar element. If none has been found, then create one.
o.stickySidebar = o.sidebar.find('.theiaStickySidebar');
if (o.stickySidebar.length == 0) {
// Remove