From 854e9de935c2bbb2a7143c73bb5e9edf98d3fc65 Mon Sep 17 00:00:00 2001 From: Simon Knox Date: Tue, 30 May 2017 18:32:49 +1000 Subject: [PATCH] animate adding issue to boards fix some false positive tests for board_new_issue --- .../boards/components/board_list.js | 13 ++++-- .../boards/components/board_new_issue.js | 2 + app/assets/javascripts/boards/models/list.js | 8 +++- .../javascripts/boards/stores/boards_store.js | 1 + app/assets/stylesheets/pages/boards.scss | 41 +++++++++++++++-- changelogs/unreleased/31633-animate-issue.yml | 4 ++ .../boards/board_new_issue_spec.js | 45 +++++++++++-------- 7 files changed, 88 insertions(+), 26 deletions(-) create mode 100644 changelogs/unreleased/31633-animate-issue.yml diff --git a/app/assets/javascripts/boards/components/board_list.js b/app/assets/javascripts/boards/components/board_list.js index 7ee2696e720..bebca17fb1e 100644 --- a/app/assets/javascripts/boards/components/board_list.js +++ b/app/assets/javascripts/boards/components/board_list.js @@ -57,6 +57,9 @@ export default { scrollTop() { return this.$refs.list.scrollTop + this.listHeight(); }, + scrollToTop() { + this.$refs.list.scrollTop = 0; + }, loadNextPage() { const getIssues = this.list.nextPage(); const loadingDone = () => { @@ -108,6 +111,7 @@ export default { }, created() { eventHub.$on(`hide-issue-form-${this.list.id}`, this.toggleForm); + eventHub.$on(`scroll-board-list-${this.list.id}`, this.scrollToTop); }, mounted() { const options = gl.issueBoards.getBoardSortableDefaultOptions({ @@ -150,6 +154,7 @@ export default { }, beforeDestroy() { eventHub.$off(`hide-issue-form-${this.list.id}`, this.toggleForm); + eventHub.$off(`scroll-board-list-${this.list.id}`, this.scrollToTop); this.$refs.list.removeEventListener('scroll', this.onScroll); }, template: ` @@ -160,9 +165,11 @@ export default { v-if="loading"> - + + +