diff options
author | Simon Knox <psimyn@gmail.com> | 2017-05-30 11:32:49 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-06-01 10:14:08 +0300 |
commit | 854e9de935c2bbb2a7143c73bb5e9edf98d3fc65 (patch) | |
tree | f3d270f72114eb7d106befd5e626fdbc9c9f323b /app/assets/javascripts/boards/components | |
parent | e5226177ac667c8ad4cc07270bbdef24031eb8a2 (diff) |
animate adding issue to boards
fix some false positive tests for board_new_issue
Diffstat (limited to 'app/assets/javascripts/boards/components')
-rw-r--r-- | app/assets/javascripts/boards/components/board_list.js | 13 | ||||
-rw-r--r-- | app/assets/javascripts/boards/components/board_new_issue.js | 2 |
2 files changed, 12 insertions, 3 deletions
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"> <loading-icon /> </div> - <board-new-issue - :list="list" - v-if="list.type !== 'closed' && showIssueForm"/> + <transition name="slide-down"> + <board-new-issue + :list="list" + v-if="list.type !== 'closed' && showIssueForm"/> + </transition> <ul class="board-list" v-show="!loading" diff --git a/app/assets/javascripts/boards/components/board_new_issue.js b/app/assets/javascripts/boards/components/board_new_issue.js index 1ce95b62138..b1c47b09c35 100644 --- a/app/assets/javascripts/boards/components/board_new_issue.js +++ b/app/assets/javascripts/boards/components/board_new_issue.js @@ -48,6 +48,7 @@ export default { this.error = true; }); + eventHub.$emit(`scroll-board-list-${this.list.id}`); this.cancel(); }, cancel() { @@ -75,6 +76,7 @@ export default { type="text" v-model="title" ref="input" + autocomplete="off" :id="list.id + '-title'" /> <div class="clearfix prepend-top-10"> <button class="btn btn-success pull-left" |