Commit 41df9687 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'ee-46610-stop-horizontal-scrolling-when-clicking-on-board-issue' into 'master'

EE port of "Removed automatic right scroll when issue an issue is clicked on the issue board"

See merge request gitlab-org/gitlab-ee!6127
parents a2351b6b b1e82180
/* eslint-disable comma-dangle, space-before-function-paren, one-var */
import $ from 'jquery';
import Sortable from 'sortablejs';
import Vue from 'vue';
import boardPromotionState from 'ee/boards/components/board_promotion_state';
......@@ -59,40 +58,6 @@ gl.issueBoards.Board = Vue.extend({
});
},
deep: true,
},
detailIssue: {
handler () {
if (!Object.keys(this.detailIssue.issue).length) return;
const issue = this.list.findIssue(this.detailIssue.issue.id);
if (issue) {
const offsetLeft = this.$el.offsetLeft;
const boardsList = document.querySelectorAll('.boards-list')[0];
const left = boardsList.scrollLeft - offsetLeft;
let right = (offsetLeft + this.$el.offsetWidth);
if (window.innerWidth > 768 && boardsList.classList.contains('is-compact')) {
// -290 here because width of boardsList is animating so therefore
// getting the width here is incorrect
// 290 is the width of the sidebar
right -= (boardsList.offsetWidth - 290);
} else {
right -= boardsList.offsetWidth;
}
if (right - boardsList.scrollLeft > 0) {
$(boardsList).animate({
scrollLeft: right
}, this.sortableOptions.animation);
} else if (left > 0) {
$(boardsList).animate({
scrollLeft: offsetLeft
}, this.sortableOptions.animation);
}
}
},
deep: true
}
},
mounted () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment