diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-19 09:01:27 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-19 09:01:27 +0100 |
commit | 356a37cf50a3a164dd6004ed06f310895539105a (patch) | |
tree | 5e70718f09f5a3eb4c07415acf58ed108288c10c /app/assets | |
parent | abccda6fd54b15ef469d9a7d21dffe098c9edb55 (diff) | |
download | gitlab-ce-356a37cf50a3a164dd6004ed06f310895539105a.tar.gz |
added spec to new file dropdown
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/ide/components/new_dropdown/index.vue | 90 |
1 files changed, 44 insertions, 46 deletions
diff --git a/app/assets/javascripts/ide/components/new_dropdown/index.vue b/app/assets/javascripts/ide/components/new_dropdown/index.vue index 94c3e8b4d19..b1b5c0d4a28 100644 --- a/app/assets/javascripts/ide/components/new_dropdown/index.vue +++ b/app/assets/javascripts/ide/components/new_dropdown/index.vue @@ -1,56 +1,54 @@ <script> - import { mapActions } from 'vuex'; - import icon from '~/vue_shared/components/icon.vue'; - import newModal from './modal.vue'; - import upload from './upload.vue'; +import { mapActions } from 'vuex'; +import icon from '~/vue_shared/components/icon.vue'; +import newModal from './modal.vue'; +import upload from './upload.vue'; - export default { - components: { - icon, - newModal, - upload, +export default { + components: { + icon, + newModal, + upload, + }, + props: { + branch: { + type: String, + required: true, }, - props: { - branch: { - type: String, - required: true, - }, - path: { - type: String, - required: true, - }, + path: { + type: String, + required: true, }, - data() { - return { - openModal: false, - modalType: '', - dropdownOpen: false, - }; + }, + data() { + return { + openModal: false, + modalType: '', + dropdownOpen: false, + }; + }, + watch: { + dropdownOpen() { + this.$nextTick(() => { + this.$refs.dropdownMenu.scrollIntoView(); + }); }, - watch: { - dropdownOpen() { - this.$nextTick(() => { - this.$refs.dropdownMenu.scrollIntoView(); - }); - }, + }, + methods: { + ...mapActions(['createTempEntry']), + createNewItem(type) { + this.modalType = type; + this.openModal = true; + this.dropdownOpen = false; }, - methods: { - ...mapActions([ - 'createTempEntry', - ]), - createNewItem(type) { - this.modalType = type; - this.openModal = true; - this.dropdownOpen = false; - }, - hideModal() { - this.openModal = false; - }, - openDropdown() { - this.dropdownOpen = !this.dropdownOpen; - }, + hideModal() { + this.openModal = false; }, - }; + openDropdown() { + this.dropdownOpen = !this.dropdownOpen; + }, + }, +}; </script> <template> |