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/job.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'app/assets/javascripts/job.js') diff --git a/app/assets/javascripts/job.js b/app/assets/javascripts/job.js index fc13f467675..e76bae08699 100644 --- a/app/assets/javascripts/job.js +++ b/app/assets/javascripts/job.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import _ from 'underscore'; -import { polyfillSticky } from './lib/utils/sticky'; +import StickyFill from 'stickyfilljs'; import axios from './lib/utils/axios_utils'; import { visitUrl } from './lib/utils/url_utility'; import bp from './breakpoints'; @@ -70,7 +70,14 @@ export default class Job extends LogOutputBehaviours { } initAffixTopArea() { - polyfillSticky(this.$topBar); + /** + If the browser does not support position sticky, it returns the position as static. + If the browser does support sticky, then we allow the browser to handle it, if not + then we use a polyfill + */ + if (this.$topBar.css('position') !== 'static') return; + + StickyFill.add(this.$topBar); } scrollToBottom() { -- cgit v1.2.1