From fe572c1725f4161a19e9d4e7422a0702568d344c Mon Sep 17 00:00:00 2001 From: Pusher Robot Date: Thu, 16 Apr 2015 12:38:58 -0400 Subject: [PATCH] Updated component to version 1.12.0 --- RELEASE-NOTES.md | 4 +++ composer.json | 2 +- index.js | 73 +++++++++++++++++++++++++++++++----------------- package.js | 2 +- package.json | 2 +- sticky.css | 2 +- sticky.js | 73 +++++++++++++++++++++++++++++++----------------- sticky.min.css | 2 +- sticky.min.js | 4 +-- 9 files changed, 105 insertions(+), 59 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index f64ed0c..b4cabfa 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,7 @@ +### Version 1.12.0 - April 13, 2015 + +- **Sticky** - Adds sticky module from `2.x` branch. Sticky elements now use pub/sub with drastically improved performance. Sticky elements that do not fit on page will now scroll at the same speed as the page is scrolled instead of slower. + ### Version 1.11.7 - April 13, 2015 - **Sticky** - Fixes errant `console.log` statement appearing in source diff --git a/composer.json b/composer.json index 1ea0575..0971d0c 100755 --- a/composer.json +++ b/composer.json @@ -15,5 +15,5 @@ "framework" ], "license": "MIT", - "version": "1.11.7" + "version": "1.12.0" } \ No newline at end of file diff --git a/index.js b/index.js index 0d26557..2b8bf72 100755 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.11.7 - Sticky + * # Semantic UI 1.12.0 - Sticky * http://github.com/semantic-org/semantic-ui/ * * @@ -88,13 +88,18 @@ module.exports = function(parameters) { }, destroy: function() { - module.verbose('Destroying previous module'); + module.verbose('Destroying previous instance'); module.reset(); if(observer) { observer.disconnect(); } - $window.off('resize' + eventNamespace, module.event.resize); - $scroll.off('scroll' + eventNamespace, module.event.scroll); + $window + .off('load' + eventNamespace, module.event.load) + .off('resize' + eventNamespace, module.event.resize) + ; + $scroll + .off('scrollchange' + eventNamespace, module.event.scrollchange) + ; $module.removeData(moduleNamespace); }, @@ -108,7 +113,7 @@ module.exports = function(parameters) { module.timer = setTimeout(function() { module.verbose('DOM tree modified, updating sticky menu'); module.refresh(); - }, 20); + }, 100); }); observer.observe(element, { childList : true, @@ -148,23 +153,36 @@ module.exports = function(parameters) { bind: { events: function() { - $window.on('resize' + eventNamespace, module.event.resize); - $scroll.on('scroll' + eventNamespace, module.event.scroll); + $window + .on('load' + eventNamespace, module.event.load) + .on('resize' + eventNamespace, module.event.resize) + ; + // pub/sub pattern + $scroll + .off('scroll' + eventNamespace) + .on('scroll' + eventNamespace, module.event.scroll) + .on('scrollchange' + eventNamespace, module.event.scrollchange) + ; } }, event: { + load: function() { + module.verbose('Page contents finished loading'); + requestAnimationFrame(module.refresh); + }, resize: function() { - requestAnimationFrame(function() { - module.refresh(); - module.stick(); - }); + module.verbose('Window resized'); + requestAnimationFrame(module.refresh); }, scroll: function() { requestAnimationFrame(function() { - module.stick(); - settings.onScroll.call(element); + $scroll.trigger('scrollchange' + eventNamespace, $scroll.scrollTop() ); }); + }, + scrollchange: function(event, scrollPosition) { + module.stick(scrollPosition); + settings.onScroll.call(element); } }, @@ -190,7 +208,7 @@ module.exports = function(parameters) { }, save: { - scroll: function(scroll) { + lastScroll: function(scroll) { module.lastScroll = scroll; }, positions: function() { @@ -269,6 +287,7 @@ module.exports = function(parameters) { : Math.abs(parseInt($module.css('bottom'), 10)) || 0 ; }, + elementScroll: function(scroll) { scroll = scroll || $scroll.scrollTop(); var @@ -276,14 +295,14 @@ module.exports = function(parameters) { window = module.cache.window, delta = module.get.scrollChange(scroll), maxScroll = (element.height - window.height + settings.offset), - currentScroll = module.get.currentElementScroll(), - possibleScroll = (currentScroll + delta), + elementScroll = module.get.currentElementScroll(), + possibleScroll = (elementScroll + delta), elementScroll ; if(module.cache.fits || possibleScroll < 0) { elementScroll = 0; } - else if (possibleScroll > maxScroll ) { + else if(possibleScroll > maxScroll ) { elementScroll = maxScroll; } else { @@ -314,8 +333,8 @@ module.exports = function(parameters) { $container = $module.offsetParent(); } else { - module.debug('Settings container size', module.cache.context.height); if( Math.abs($container.height() - module.cache.context.height) > 5) { + module.debug('Context has padding, specifying exact height for container', module.cache.context.height); $container.css({ height: module.cache.context.height }); @@ -370,8 +389,9 @@ module.exports = function(parameters) { } }, - stick: function() { + stick: function(scroll) { var + cachedPosition = scroll || $scroll.scrollTop(), cache = module.cache, fits = cache.fits, element = cache.element, @@ -381,11 +401,13 @@ module.exports = function(parameters) { ? settings.bottomOffset : settings.offset, scroll = { - top : $scroll.scrollTop() + offset, - bottom : $scroll.scrollTop() + offset + window.height + top : cachedPosition + offset, + bottom : cachedPosition + offset + window.height }, direction = module.get.direction(scroll.top), - elementScroll = module.get.elementScroll(scroll.top), + elementScroll = (fits) + ? 0 + : module.get.elementScroll(scroll.top), // shorthand doesntFit = !fits, @@ -393,7 +415,7 @@ module.exports = function(parameters) { ; // save current scroll for next run - module.save.scroll(scroll.top); + module.save.lastScroll(scroll.top); if(elementVisible) { @@ -553,13 +575,12 @@ module.exports = function(parameters) { module.unbind(); module.unfix(); module.resetCSS(); + module.remove.offset(); }, resetCSS: function() { $module .css({ - top : '', - bottom : '', width : '', height : '' }) @@ -789,4 +810,4 @@ module.exports.settings = { }; -})( require("jquery"), window , document ); +})( require("jquery"), window , document ); \ No newline at end of file diff --git a/package.js b/package.js index 192655e..72108c9 100755 --- a/package.js +++ b/package.js @@ -2,7 +2,7 @@ Package.describe({ name : 'semantic:ui-sticky', summary : 'Semantic UI - Sticky: Single component release', - version : '1.11.7', + version : '1.12.0', git : 'git://github.com/Semantic-Org/UI-Sticky.git', }); diff --git a/package.json b/package.json index b245dbd..2c40ec4 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semantic-ui-sticky", - "version": "1.11.7", + "version": "1.12.0", "title": "Semantic UI - Sticky", "description": "Single component release of sticky", "homepage": "http://www.semantic-ui.com", diff --git a/sticky.css b/sticky.css index f8b5862..8c8b601 100755 --- a/sticky.css +++ b/sticky.css @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.11.7 - Sticky + * # Semantic UI 1.12.0 - Sticky * http://github.com/semantic-org/semantic-ui/ * * diff --git a/sticky.js b/sticky.js index d512b4b..48ca373 100755 --- a/sticky.js +++ b/sticky.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.11.7 - Sticky + * # Semantic UI 1.12.0 - Sticky * http://github.com/semantic-org/semantic-ui/ * * @@ -87,13 +87,18 @@ $.fn.sticky = function(parameters) { }, destroy: function() { - module.verbose('Destroying previous module'); + module.verbose('Destroying previous instance'); module.reset(); if(observer) { observer.disconnect(); } - $window.off('resize' + eventNamespace, module.event.resize); - $scroll.off('scroll' + eventNamespace, module.event.scroll); + $window + .off('load' + eventNamespace, module.event.load) + .off('resize' + eventNamespace, module.event.resize) + ; + $scroll + .off('scrollchange' + eventNamespace, module.event.scrollchange) + ; $module.removeData(moduleNamespace); }, @@ -107,7 +112,7 @@ $.fn.sticky = function(parameters) { module.timer = setTimeout(function() { module.verbose('DOM tree modified, updating sticky menu'); module.refresh(); - }, 20); + }, 100); }); observer.observe(element, { childList : true, @@ -147,23 +152,36 @@ $.fn.sticky = function(parameters) { bind: { events: function() { - $window.on('resize' + eventNamespace, module.event.resize); - $scroll.on('scroll' + eventNamespace, module.event.scroll); + $window + .on('load' + eventNamespace, module.event.load) + .on('resize' + eventNamespace, module.event.resize) + ; + // pub/sub pattern + $scroll + .off('scroll' + eventNamespace) + .on('scroll' + eventNamespace, module.event.scroll) + .on('scrollchange' + eventNamespace, module.event.scrollchange) + ; } }, event: { + load: function() { + module.verbose('Page contents finished loading'); + requestAnimationFrame(module.refresh); + }, resize: function() { - requestAnimationFrame(function() { - module.refresh(); - module.stick(); - }); + module.verbose('Window resized'); + requestAnimationFrame(module.refresh); }, scroll: function() { requestAnimationFrame(function() { - module.stick(); - settings.onScroll.call(element); + $scroll.trigger('scrollchange' + eventNamespace, $scroll.scrollTop() ); }); + }, + scrollchange: function(event, scrollPosition) { + module.stick(scrollPosition); + settings.onScroll.call(element); } }, @@ -189,7 +207,7 @@ $.fn.sticky = function(parameters) { }, save: { - scroll: function(scroll) { + lastScroll: function(scroll) { module.lastScroll = scroll; }, positions: function() { @@ -268,6 +286,7 @@ $.fn.sticky = function(parameters) { : Math.abs(parseInt($module.css('bottom'), 10)) || 0 ; }, + elementScroll: function(scroll) { scroll = scroll || $scroll.scrollTop(); var @@ -275,14 +294,14 @@ $.fn.sticky = function(parameters) { window = module.cache.window, delta = module.get.scrollChange(scroll), maxScroll = (element.height - window.height + settings.offset), - currentScroll = module.get.currentElementScroll(), - possibleScroll = (currentScroll + delta), + elementScroll = module.get.currentElementScroll(), + possibleScroll = (elementScroll + delta), elementScroll ; if(module.cache.fits || possibleScroll < 0) { elementScroll = 0; } - else if (possibleScroll > maxScroll ) { + else if(possibleScroll > maxScroll ) { elementScroll = maxScroll; } else { @@ -313,8 +332,8 @@ $.fn.sticky = function(parameters) { $container = $module.offsetParent(); } else { - module.debug('Settings container size', module.cache.context.height); if( Math.abs($container.height() - module.cache.context.height) > 5) { + module.debug('Context has padding, specifying exact height for container', module.cache.context.height); $container.css({ height: module.cache.context.height }); @@ -369,8 +388,9 @@ $.fn.sticky = function(parameters) { } }, - stick: function() { + stick: function(scroll) { var + cachedPosition = scroll || $scroll.scrollTop(), cache = module.cache, fits = cache.fits, element = cache.element, @@ -380,11 +400,13 @@ $.fn.sticky = function(parameters) { ? settings.bottomOffset : settings.offset, scroll = { - top : $scroll.scrollTop() + offset, - bottom : $scroll.scrollTop() + offset + window.height + top : cachedPosition + offset, + bottom : cachedPosition + offset + window.height }, direction = module.get.direction(scroll.top), - elementScroll = module.get.elementScroll(scroll.top), + elementScroll = (fits) + ? 0 + : module.get.elementScroll(scroll.top), // shorthand doesntFit = !fits, @@ -392,7 +414,7 @@ $.fn.sticky = function(parameters) { ; // save current scroll for next run - module.save.scroll(scroll.top); + module.save.lastScroll(scroll.top); if(elementVisible) { @@ -552,13 +574,12 @@ $.fn.sticky = function(parameters) { module.unbind(); module.unfix(); module.resetCSS(); + module.remove.offset(); }, resetCSS: function() { $module .css({ - top : '', - bottom : '', width : '', height : '' }) @@ -788,4 +809,4 @@ $.fn.sticky.settings = { }; -})( jQuery, window , document ); +})( jQuery, window , document ); \ No newline at end of file diff --git a/sticky.min.css b/sticky.min.css index 61d13e4..fc1e56c 100755 --- a/sticky.min.css +++ b/sticky.min.css @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.11.7 - Sticky + * # Semantic UI 1.12.0 - Sticky * http://github.com/semantic-org/semantic-ui/ * * diff --git a/sticky.min.js b/sticky.min.js index 70cc174..95ea5b7 100755 --- a/sticky.min.js +++ b/sticky.min.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.11.7 - Sticky + * # Semantic UI 1.12.0 - Sticky * http://github.com/semantic-org/semantic-ui/ * * @@ -8,4 +8,4 @@ * http://opensource.org/licenses/MIT * */ -!function(e,t,o,n){"use strict";e.fn.sticky=function(o){var i,s=e(this),r=s.selector||"",c=(new Date).getTime(),a=[],l=arguments[0],m="string"==typeof l,f=[].slice.call(arguments,1);return s.each(function(){var s,u,d,h=e.isPlainObject(o)?e.extend(!0,{},e.fn.sticky.settings,o):e.extend({},e.fn.sticky.settings),b=h.className,g=h.namespace,p=h.error,v="."+g,x="module-"+g,C=e(this),k=e(t),y=C.offsetParent(),S=e(h.scrollContext),T=(C.selector||"",C.data(x)),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},P=this;d={initialize:function(){d.determineContext(),d.verbose("Initializing sticky",h,y),d.save.positions(),d.checkErrors(),d.bind.events(),h.observeChanges&&d.observeChanges(),d.instantiate()},instantiate:function(){d.verbose("Storing instance of module",d),T=d,C.data(x,d)},destroy:function(){d.verbose("Destroying previous module"),d.reset(),u&&u.disconnect(),k.off("resize"+v,d.event.resize),S.off("scroll"+v,d.event.scroll),C.removeData(x)},observeChanges:function(){var e=s[0];"MutationObserver"in t&&(u=new MutationObserver(function(){clearTimeout(d.timer),d.timer=setTimeout(function(){d.verbose("DOM tree modified, updating sticky menu"),d.refresh()},20)}),u.observe(P,{childList:!0,subtree:!0}),u.observe(e,{childList:!0,subtree:!0}),d.debug("Setting up mutation observer",u))},determineContext:function(){return s=h.context?e(h.context):y,0===s.length?void d.error(p.invalidContext,h.context,C):void 0},checkErrors:function(){return d.is.hidden()&&d.error(p.visible,C),d.cache.element.height>d.cache.context.height?(d.reset(),void d.error(p.elementSize,C)):void 0},bind:{events:function(){k.on("resize"+v,d.event.resize),S.on("scroll"+v,d.event.scroll)}},event:{resize:function(){w(function(){d.refresh(),d.stick()})},scroll:function(){w(function(){d.stick(),h.onScroll.call(P)})}},refresh:function(e){d.reset(),e&&(y=C.offsetParent()),d.save.positions(),d.stick(),h.onReposition.call(P)},supports:{sticky:function(){{var t=e("
");t.get()}return t.addClass(b.supported),t.css("position").match("sticky")}},save:{scroll:function(e){d.lastScroll=e},positions:function(){var e={height:k.height()},t={margin:{top:parseInt(C.css("margin-top"),10),bottom:parseInt(C.css("margin-bottom"),10)},offset:C.offset(),width:C.outerWidth(),height:C.outerHeight()},o={offset:s.offset(),height:s.outerHeight(),bottomPadding:parseInt(s.css("padding-bottom"),10)};d.cache={fits:t.heighte&&(t="up")),t},scrollChange:function(e){return e=e||S.scrollTop(),d.lastScroll?e-d.lastScroll:0},currentElementScroll:function(){return d.is.top()?Math.abs(parseInt(C.css("top"),10))||0:Math.abs(parseInt(C.css("bottom"),10))||0},elementScroll:function(e){e=e||S.scrollTop();var t,o=d.cache.element,n=d.cache.window,i=d.get.scrollChange(e),s=o.height-n.height+h.offset,r=d.get.currentElementScroll(),c=r+i;return t=d.cache.fits||0>c?0:c>s?s:c}},remove:{offset:function(){C.css("margin-top","")}},set:{offset:function(){d.verbose("Setting offset on element",h.offset),C.css("margin-top",h.offset)},containerSize:function(){var e=y.get(0).tagName;"HTML"===e||"body"==e?y=C.offsetParent():(d.debug("Settings container size",d.cache.context.height),Math.abs(y.height()-d.cache.context.height)>5&&y.css({height:d.cache.context.height}))},scroll:function(e){d.debug("Setting scroll on element",e),d.is.top()&&C.css("bottom","").css("top",-e),d.is.bottom()&&C.css("top","").css("bottom",e)},size:function(){0!==d.cache.element.height&&0!==d.cache.element.width&&C.css({width:d.cache.element.width,height:d.cache.element.height})}},is:{top:function(){return C.hasClass(b.top)},bottom:function(){return C.hasClass(b.bottom)},initialPosition:function(){return!d.is.fixed()&&!d.is.bound()},hidden:function(){return!C.is(":visible")},bound:function(){return C.hasClass(b.bound)},fixed:function(){return C.hasClass(b.fixed)}},stick:function(){var e=d.cache,t=e.fits,o=e.element,n=e.window,i=e.context,s=d.is.bottom()&&h.pushing?h.bottomOffset:h.offset,r={top:S.scrollTop()+s,bottom:S.scrollTop()+s+n.height},c=(d.get.direction(r.top),d.get.elementScroll(r.top)),a=!t,l=0!==o.height;d.save.scroll(r.top),l&&(d.is.initialPosition()?r.top>=i.bottom?(d.debug("Element bottom of container"),d.bindBottom()):r.top>=o.top&&(d.debug("Element passed, fixing element to page"),d.fixTop()):d.is.fixed()?d.is.top()?r.topi.bottom?(d.debug("Fixed element reached bottom of container"),d.bindBottom()):a&&d.set.scroll(c):d.is.bottom()&&(r.bottom-o.heighti.bottom?(d.debug("Bottom fixed rail has reached bottom of container"),d.bindBottom()):a&&d.set.scroll(c)):d.is.bottom()&&(h.pushing?d.is.bound()&&r.bottom0&&(console.groupCollapsed(t),console.table?console.table(a):e.each(a,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),a=[]}},invoke:function(t,o,s){var r,c,a,l=T;return o=o||f,s=P||s,"string"==typeof t&&l!==n&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(o,i){var s=o!=r?i+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(l[s])&&o!=r)l=l[s];else{if(l[s]!==n)return c=l[s],!1;if(!e.isPlainObject(l[i])||o==r)return l[i]!==n?(c=l[i],!1):!1;l=l[i]}})),e.isFunction(c)?a=c.apply(s,o):c!==n&&(a=c),e.isArray(i)?i.push(a):i!==n?i=[i,a]:a!==n&&(i=a),c}},m?(T===n&&d.initialize(),d.invoke(l)):(T!==n&&T.invoke("destroy"),d.initialize())}),i!==n?i:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",debug:!1,verbose:!1,performance:!1,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset:0,observeChanges:!0,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document); \ No newline at end of file +!function(e,t,o,n){"use strict";e.fn.sticky=function(o){var i,s=e(this),c=s.selector||"",r=(new Date).getTime(),a=[],l=arguments[0],f="string"==typeof l,m=[].slice.call(arguments,1);return s.each(function(){var s,u,d,h=e.isPlainObject(o)?e.extend(!0,{},e.fn.sticky.settings,o):e.extend({},e.fn.sticky.settings),g=h.className,b=h.namespace,p=h.error,v="."+b,x="module-"+b,C=e(this),y=e(t),S=C.offsetParent(),k=e(h.scrollContext),w=(C.selector||"",C.data(x)),T=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},P=this;d={initialize:function(){d.determineContext(),d.verbose("Initializing sticky",h,S),d.save.positions(),d.checkErrors(),d.bind.events(),h.observeChanges&&d.observeChanges(),d.instantiate()},instantiate:function(){d.verbose("Storing instance of module",d),w=d,C.data(x,d)},destroy:function(){d.verbose("Destroying previous instance"),d.reset(),u&&u.disconnect(),y.off("load"+v,d.event.load).off("resize"+v,d.event.resize),k.off("scrollchange"+v,d.event.scrollchange),C.removeData(x)},observeChanges:function(){var e=s[0];"MutationObserver"in t&&(u=new MutationObserver(function(){clearTimeout(d.timer),d.timer=setTimeout(function(){d.verbose("DOM tree modified, updating sticky menu"),d.refresh()},100)}),u.observe(P,{childList:!0,subtree:!0}),u.observe(e,{childList:!0,subtree:!0}),d.debug("Setting up mutation observer",u))},determineContext:function(){return s=h.context?e(h.context):S,0===s.length?void d.error(p.invalidContext,h.context,C):void 0},checkErrors:function(){return d.is.hidden()&&d.error(p.visible,C),d.cache.element.height>d.cache.context.height?(d.reset(),void d.error(p.elementSize,C)):void 0},bind:{events:function(){y.on("load"+v,d.event.load).on("resize"+v,d.event.resize),k.off("scroll"+v).on("scroll"+v,d.event.scroll).on("scrollchange"+v,d.event.scrollchange)}},event:{load:function(){d.verbose("Page contents finished loading"),T(d.refresh)},resize:function(){d.verbose("Window resized"),T(d.refresh)},scroll:function(){T(function(){k.trigger("scrollchange"+v,k.scrollTop())})},scrollchange:function(e,t){d.stick(t),h.onScroll.call(P)}},refresh:function(e){d.reset(),e&&(S=C.offsetParent()),d.save.positions(),d.stick(),h.onReposition.call(P)},supports:{sticky:function(){{var t=e("
");t.get()}return t.addClass(g.supported),t.css("position").match("sticky")}},save:{lastScroll:function(e){d.lastScroll=e},positions:function(){var e={height:y.height()},t={margin:{top:parseInt(C.css("margin-top"),10),bottom:parseInt(C.css("margin-bottom"),10)},offset:C.offset(),width:C.outerWidth(),height:C.outerHeight()},o={offset:s.offset(),height:s.outerHeight(),bottomPadding:parseInt(s.css("padding-bottom"),10)};d.cache={fits:t.heighte&&(t="up")),t},scrollChange:function(e){return e=e||k.scrollTop(),d.lastScroll?e-d.lastScroll:0},currentElementScroll:function(){return d.is.top()?Math.abs(parseInt(C.css("top"),10))||0:Math.abs(parseInt(C.css("bottom"),10))||0},elementScroll:function(e){e=e||k.scrollTop();var t,o=d.cache.element,n=d.cache.window,i=d.get.scrollChange(e),s=o.height-n.height+h.offset,t=d.get.currentElementScroll(),c=t+i;return t=d.cache.fits||0>c?0:c>s?s:c}},remove:{offset:function(){C.css("margin-top","")}},set:{offset:function(){d.verbose("Setting offset on element",h.offset),C.css("margin-top",h.offset)},containerSize:function(){var e=S.get(0).tagName;"HTML"===e||"body"==e?S=C.offsetParent():Math.abs(S.height()-d.cache.context.height)>5&&(d.debug("Context has padding, specifying exact height for container",d.cache.context.height),S.css({height:d.cache.context.height}))},scroll:function(e){d.debug("Setting scroll on element",e),d.is.top()&&C.css("bottom","").css("top",-e),d.is.bottom()&&C.css("top","").css("bottom",e)},size:function(){0!==d.cache.element.height&&0!==d.cache.element.width&&C.css({width:d.cache.element.width,height:d.cache.element.height})}},is:{top:function(){return C.hasClass(g.top)},bottom:function(){return C.hasClass(g.bottom)},initialPosition:function(){return!d.is.fixed()&&!d.is.bound()},hidden:function(){return!C.is(":visible")},bound:function(){return C.hasClass(g.bound)},fixed:function(){return C.hasClass(g.fixed)}},stick:function(e){var t=e||k.scrollTop(),o=d.cache,n=o.fits,i=o.element,s=o.window,c=o.context,r=d.is.bottom()&&h.pushing?h.bottomOffset:h.offset,e={top:t+r,bottom:t+r+s.height},a=(d.get.direction(e.top),n?0:d.get.elementScroll(e.top)),l=!n,f=0!==i.height;d.save.lastScroll(e.top),f&&(d.is.initialPosition()?e.top>=c.bottom?(d.debug("Element bottom of container"),d.bindBottom()):e.top>=i.top&&(d.debug("Element passed, fixing element to page"),d.fixTop()):d.is.fixed()?d.is.top()?e.topc.bottom?(d.debug("Fixed element reached bottom of container"),d.bindBottom()):l&&d.set.scroll(a):d.is.bottom()&&(e.bottom-i.heightc.bottom?(d.debug("Bottom fixed rail has reached bottom of container"),d.bindBottom()):l&&d.set.scroll(a)):d.is.bottom()&&(h.pushing?d.is.bound()&&e.bottom0&&(console.groupCollapsed(t),console.table?console.table(a):e.each(a,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),a=[]}},invoke:function(t,o,s){var c,r,a,l=w;return o=o||m,s=P||s,"string"==typeof t&&l!==n&&(t=t.split(/[\. ]/),c=t.length-1,e.each(t,function(o,i){var s=o!=c?i+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(l[s])&&o!=c)l=l[s];else{if(l[s]!==n)return r=l[s],!1;if(!e.isPlainObject(l[i])||o==c)return l[i]!==n?(r=l[i],!1):!1;l=l[i]}})),e.isFunction(r)?a=r.apply(s,o):r!==n&&(a=r),e.isArray(i)?i.push(a):i!==n?i=[i,a]:a!==n&&(i=a),r}},f?(w===n&&d.initialize(),d.invoke(l)):(w!==n&&w.invoke("destroy"),d.initialize())}),i!==n?i:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",debug:!1,verbose:!1,performance:!1,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset:0,observeChanges:!0,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document); \ No newline at end of file