From b8dbbfd2c664d95bf459609eb6c006a0f8cfb118 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Thu, 7 Jun 2018 15:00:55 +0000 Subject: Revert "Merge branch '46833-sticky-polyfill' into 'master'" This reverts merge request !19324 --- app/assets/javascripts/lib/utils/sticky.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'app/assets/javascripts/lib/utils/sticky.js') diff --git a/app/assets/javascripts/lib/utils/sticky.js b/app/assets/javascripts/lib/utils/sticky.js index 15a4dd62012..098afcfa1b4 100644 --- a/app/assets/javascripts/lib/utils/sticky.js +++ b/app/assets/javascripts/lib/utils/sticky.js @@ -1,5 +1,3 @@ -import StickyFill from 'stickyfilljs'; - export const createPlaceholder = () => { const placeholder = document.createElement('div'); placeholder.classList.add('sticky-placeholder'); @@ -30,16 +28,7 @@ export const isSticky = (el, scrollY, stickyTop, insertPlaceholder) => { } }; -/** - * Create a listener that will toggle a 'is-stuck' class, based on the current scroll position. - * - * - If the current environment does not support `position: sticky`, do nothing. - * - * @param {HTMLElement} el The `position: sticky` element. - * @param {Number} stickyTop Used to determine when an element is stuck. - * @param {Boolean} insertPlaceholder Should a placeholder element be created when element is stuck? - */ -export const stickyMonitor = (el, stickyTop, insertPlaceholder = true) => { +export default (el, stickyTop, insertPlaceholder = true) => { if (!el) return; if (typeof CSS === 'undefined' || !(CSS.supports('(position: -webkit-sticky) or (position: sticky)'))) return; @@ -48,13 +37,3 @@ export const stickyMonitor = (el, stickyTop, insertPlaceholder = true) => { passive: true, }); }; - -/** - * Polyfill the `position: sticky` behavior. - * - * - If the current environment supports `position: sticky`, do nothing. - * - Can receive an iterable element list (NodeList, jQuery collection, etc.) or single HTMLElement. - */ -export const polyfillSticky = (el) => { - StickyFill.add(el); -}; -- cgit v1.2.1