diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2019-04-04 13:55:49 -0500 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-04-04 15:35:45 -0500 |
commit | c1a097e1cee43b127de17d769546ffa244cbf484 (patch) | |
tree | dac9796a9f7a325407d47f1e2fe2e7966ae6a678 /app/assets/javascripts/vue_shared/components/file_row.vue | |
parent | 9deaa79c5eb42618756288d85c8ad2c757e0589f (diff) | |
download | gitlab-ce-c1a097e1cee43b127de17d769546ffa244cbf484.tar.gz |
Refactor new_dropdown/index to receive isOpen prop60021-fix-ide-file-dropdown
**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.vue | 12 |
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> |