Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-06-12 18:31:22 +0300
committerFilipa Lacerda <filipa@gitlab.com>2019-06-12 18:31:22 +0300
commit9f832e59ab659d27865704f9f0b43f81f6f2aa8a (patch)
tree75c2ca9bc4827a07e78c641937c2712f408bac32 /app/assets/javascripts
parent4e249e542cdf9f515c01346a9c9ace10e414644c (diff)
Adds margins to the section lines
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/jobs/components/job_log.vue17
1 files changed, 9 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'));
},
},