diff options
author | Phil Hughes <me@iamphill.com> | 2017-06-07 10:41:24 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-06-07 10:41:24 +0300 |
commit | 9c2f82842b9d4d985ab8fadf47bcbac22ec76bd6 (patch) | |
tree | 9614574f6e829305cd708a2f727a103f2940ac37 /app/assets/javascripts/boards/components | |
parent | eebd18c3ac6a77e29693c8e1892782acdf20e262 (diff) | |
parent | 854e9de935c2bbb2a7143c73bb5e9edf98d3fc65 (diff) |
Merge branch '31633-animate-issue' into 'master'
animate adding issue to boards
Closes #31633
See merge request !11785
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" |