diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-11-01 15:20:54 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-11-01 15:20:54 +0000 |
commit | 3c99d8308a481b3f6edb002912ffc4d760b7fb64 (patch) | |
tree | 73555ed44c63103ae57836dd00587e45d084dff2 /app/assets/javascripts/jobs/components/job_log.vue | |
parent | 0336dc438b6faab575df996364076b57e388cc27 (diff) | |
parent | d3a407d66fa553f3ff8afd1b9e42f01b9912e14a (diff) | |
download | gitlab-ce-3c99d8308a481b3f6edb002912ffc4d760b7fb64.tar.gz |
Merge branch 'master' into 'gl-ui-progress-bar'gl-ui-progress-bar
# Conflicts:
# app/assets/javascripts/commons/gitlab_ui.js
Diffstat (limited to 'app/assets/javascripts/jobs/components/job_log.vue')
-rw-r--r-- | app/assets/javascripts/jobs/components/job_log.vue | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/app/assets/javascripts/jobs/components/job_log.vue b/app/assets/javascripts/jobs/components/job_log.vue index ffa6ada3e28..92e20e92d66 100644 --- a/app/assets/javascripts/jobs/components/job_log.vue +++ b/app/assets/javascripts/jobs/components/job_log.vue @@ -1,45 +1,45 @@ <script> - import { mapState, mapActions } from 'vuex'; +import { mapState, mapActions } from 'vuex'; - export default { - name: 'JobLog', - props: { - trace: { - type: String, - required: true, - }, - isComplete: { - type: Boolean, - required: true, - }, +export default { + name: 'JobLog', + props: { + trace: { + type: String, + required: true, }, - computed: { - ...mapState(['isScrolledToBottomBeforeReceivingTrace']), + isComplete: { + type: Boolean, + required: true, }, - updated() { - this.$nextTick(() => this.handleScrollDown()); + }, + computed: { + ...mapState(['isScrolledToBottomBeforeReceivingTrace']), + }, + updated() { + this.$nextTick(() => this.handleScrollDown()); + }, + mounted() { + this.$nextTick(() => this.handleScrollDown()); + }, + methods: { + ...mapActions(['scrollBottom']), + /** + * The job log is sent in HTML, which means we need to use `v-html` to render it + * Using the updated hook with $nextTick is not enough to wait for the DOM to be updated + * in this case because it runs before `v-html` has finished running, since there's no + * Vue binding. + * In order to scroll the page down after `v-html` has finished, we need to use setTimeout + */ + handleScrollDown() { + if (this.isScrolledToBottomBeforeReceivingTrace) { + setTimeout(() => { + this.scrollBottom(); + }, 0); + } }, - mounted() { - this.$nextTick(() => this.handleScrollDown()); - }, - methods: { - ...mapActions(['scrollBottom']), - /** - * The job log is sent in HTML, which means we need to use `v-html` to render it - * Using the updated hook with $nextTick is not enough to wait for the DOM to be updated - * in this case because it runs before `v-html` has finished running, since there's no - * Vue binding. - * In order to scroll the page down after `v-html` has finished, we need to use setTimeout - */ - handleScrollDown() { - if (this.isScrolledToBottomBeforeReceivingTrace) { - setTimeout(() => { - this.scrollBottom(); - }, 0); - } - }, - }, - }; + }, +}; </script> <template> <pre class="js-build-trace build-trace qa-build-trace"> |