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:
authorPaul Slaughter <pslaughter@gitlab.com>2019-04-04 21:55:49 +0300
committerPaul Slaughter <pslaughter@gitlab.com>2019-04-04 23:35:45 +0300
commitc1a097e1cee43b127de17d769546ffa244cbf484 (patch)
treedac9796a9f7a325407d47f1e2fe2e7966ae6a678 /app/assets/javascripts/vue_shared/components/file_row.vue
parent9deaa79c5eb42618756288d85c8ad2c757e0589f (diff)
Refactor new_dropdown/index to receive isOpen prop
**Why?** Previously it managed this as an internal data property, but there was extra complexity involved because the component doesn't have all the information it needs (i.e. the `mouseOver` prop). This is a good opportunity to colocate the data prop with the component that has the information to change it (i.e. `file_row`) and let `new_dropdown/index` receive this value as a prop.
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/file_row.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/file_row.vue12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_shared/components/file_row.vue b/app/assets/javascripts/vue_shared/components/file_row.vue
index 7096c1f4518..1bfa91500cb 100644
--- a/app/assets/javascripts/vue_shared/components/file_row.vue
+++ b/app/assets/javascripts/vue_shared/components/file_row.vue
@@ -39,7 +39,7 @@ export default {
},
data() {
return {
- mouseOver: false,
+ dropdownOpen: false,
};
},
computed: {
@@ -123,8 +123,8 @@ export default {
return this.$router.currentRoute.path === `/project${this.file.url}`;
},
- toggleHover(over) {
- this.mouseOver = over;
+ toggleDropdown(val) {
+ this.dropdownOpen = val;
},
},
};
@@ -140,8 +140,7 @@ export default {
class="file-row"
role="button"
@click="clickFile"
- @mouseover="toggleHover(true)"
- @mouseleave="toggleHover(false)"
+ @mouseleave="toggleDropdown(false)"
>
<div class="file-row-name-container">
<span ref="textOutput" :style="levelIndentation" class="file-row-name str-truncated">
@@ -160,7 +159,8 @@ export default {
:is="extraComponent"
v-if="extraComponent && !(hideExtraOnTree && file.type === 'tree')"
:file="file"
- :mouse-over="mouseOver"
+ :dropdown-open="dropdownOpen"
+ @toggle="toggleDropdown($event)"
/>
</div>
</div>