fixed karma tests

This commit is contained in:
Phil Hughes 2017-10-23 14:24:51 +01:00
parent 35daaa36e0
commit f03d9a9b42
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
1 changed files with 2 additions and 1 deletions

View File

@ -68,6 +68,7 @@ import Diff from './diff';
constructor({ action, setUrl, stubLocation } = {}) {
const mergeRequestTabs = document.querySelector('.js-tabs-affix');
const navbar = document.querySelector('.navbar-gitlab');
const paddingTop = 16;
this.diffsLoaded = false;
@ -79,7 +80,7 @@ import Diff from './diff';
this.setCurrentAction = this.setCurrentAction.bind(this);
this.tabShown = this.tabShown.bind(this);
this.showTab = this.showTab.bind(this);
this.stickyTop = document.querySelector('.navbar-gitlab').offsetHeight - paddingTop;
this.stickyTop = navbar ? navbar.offsetHeight - paddingTop : 0;
if (mergeRequestTabs) {
this.stickyTop += mergeRequestTabs.offsetHeight;