diff --git a/lib/js/calcite-web.js b/lib/js/calcite-web.js index 000b30dc0..8cd9b8e3e 100644 --- a/lib/js/calcite-web.js +++ b/lib/js/calcite-web.js @@ -544,8 +544,8 @@ // │ Sticky │ // └────────┘ // sticks things to the window - calcite.sticky = function () { - var elements = findElements('.js-sticky'); + calcite.sticky = function (domNode) { + var elements = findElements('.js-sticky', domNode); var stickies = elements.map(function (el) { var offset = el.offsetTop; @@ -588,8 +588,10 @@ }); }; - calcite.addEvent(window, 'scroll', scrollHandler); - calcite.addEvent(window, 'resize', resize); + if (elements) { + calcite.addEvent(window, 'scroll', scrollHandler); + calcite.addEvent(window, 'resize', resize); + } }; // ┌───────────┐