diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-06-12 18:31:22 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-06-12 18:31:22 +0300 |
commit | 9f832e59ab659d27865704f9f0b43f81f6f2aa8a (patch) | |
tree | 75c2ca9bc4827a07e78c641937c2712f408bac32 /app | |
parent | 4e249e542cdf9f515c01346a9c9ace10e414644c (diff) |
Adds margins to the section lines
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/jobs/components/job_log.vue | 17 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/builds.scss | 4 |
2 files changed, 13 insertions, 8 deletions
diff --git a/app/assets/javascripts/jobs/components/job_log.vue b/app/assets/javascripts/jobs/components/job_log.vue index e845a84e872..8e4557e2b6c 100644 --- a/app/assets/javascripts/jobs/components/job_log.vue +++ b/app/assets/javascripts/jobs/components/job_log.vue @@ -29,9 +29,7 @@ export default { }); }, destroyed() { - this.$el - .querySelector('.js-section-start') - .removeEventListener('click', this.handleSectionClick); + this.removeEventListener(); }, methods: { ...mapActions(['scrollBottom']), @@ -49,6 +47,11 @@ export default { }, 0); } }, + removeEventListener() { + this.$el + .querySelector('.js-section-start') + .removeEventListener('click', this.handleSectionClick); + }, /** * The collapsible rows are sent in HTML from the backend * We need to add a onclick handler for the divs that match `.js-section-start` @@ -60,7 +63,8 @@ export default { .forEach(el => el.addEventListener('click', this.handleSectionClick)); }, /** - * + * On click, we toggle the hidden class of + * all the rows that match the `data-section` selector */ handleSectionClick(evt) { const clickedArrow = evt.currentTarget; @@ -70,11 +74,8 @@ export default { clickedArrow.classList.toggle('fa-caret-down'); const dataSection = clickedArrow.getAttribute('data-section'); - const sibilings = this.$el.querySelectorAll( - `.s_${dataSection}:not(.js-section-header)`, - ); + const sibilings = this.$el.querySelectorAll(`.js-s_${dataSection}:not(.js-section-header)`); - // Get all sibilings between the clicked element and the next sibilings.forEach(row => row.classList.toggle('hidden')); }, }, diff --git a/app/assets/stylesheets/pages/builds.scss b/app/assets/stylesheets/pages/builds.scss index 6fc742871e7..6e98908eeed 100644 --- a/app/assets/stylesheets/pages/builds.scss +++ b/app/assets/stylesheets/pages/builds.scss @@ -124,6 +124,10 @@ float: left; padding-left: $gl-padding-8; } + + .section-header ~ .section.line { + margin-left: $gl-padding; + } } .build-header { |