diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-03-25 21:19:12 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-03-28 13:17:02 +0300 |
commit | 1814fc3fe410b36aeeb6ca9df5804dec871fc97b (patch) | |
tree | e7e79ef65944217e16d3814d3c93a42108d83d53 /app/assets/javascripts/vue_merge_request_widget | |
parent | 0ea359d2cfd97f4271f812ba9f216bcf4ae42c20 (diff) |
Fix for MR Widget Header reset
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue index bbe7f511cbe..3d886e7d628 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue @@ -1,53 +1,53 @@ <script> -import tooltip from '~/vue_shared/directives/tooltip'; -import { n__ } from '~/locale'; -import icon from '~/vue_shared/components/icon.vue'; -import clipboardButton from '~/vue_shared/components/clipboard_button.vue'; + import tooltip from '~/vue_shared/directives/tooltip'; + import { n__ } from '~/locale'; + import icon from '~/vue_shared/components/icon.vue'; + import clipboardButton from '~/vue_shared/components/clipboard_button.vue'; -export default { - name: 'MRWidgetHeader', - directives: { - tooltip, - }, - components: { - icon, - clipboardButton, - }, - props: { - mr: { - type: Object, - required: true, + export default { + name: 'MRWidgetHeader', + directives: { + tooltip, }, - }, - computed: { - shouldShowCommitsBehindText() { - return this.mr.divergedCommitsCount > 0; + components: { + icon, + clipboardButton, }, - commitsText() { - return n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount); + props: { + mr: { + type: Object, + required: true, + }, }, - branchNameClipboardData() { - // This supports code in app/assets/javascripts/copy_to_clipboard.js that - // works around ClipboardJS limitations to allow the context-specific - // copy/pasting of plain text or GFM. - return JSON.stringify({ - text: this.mr.sourceBranch, - gfm: `\`${this.mr.sourceBranch}\``, - }); + computed: { + shouldShowCommitsBehindText() { + return this.mr.divergedCommitsCount > 0; + }, + commitsText() { + return n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount); + }, + branchNameClipboardData() { + // This supports code in app/assets/javascripts/copy_to_clipboard.js that + // works around ClipboardJS limitations to allow the context-specific + // copy/pasting of plain text or GFM. + return JSON.stringify({ + text: this.mr.sourceBranch, + gfm: `\`${this.mr.sourceBranch}\``, + }); + }, + isSourceBranchLong() { + return this.isBranchTitleLong(this.mr.sourceBranch); + }, + isTargetBranchLong() { + return this.isBranchTitleLong(this.mr.targetBranch); + }, }, - isSourceBranchLong() { - return this.isBranchTitleLong(this.mr.sourceBranch); + methods: { + isBranchTitleLong(branchTitle) { + return branchTitle.length > 32; + }, }, - isTargetBranchLong() { - return this.isBranchTitleLong(this.mr.targetBranch); - }, - }, - methods: { - isBranchTitleLong(branchTitle) { - return branchTitle.length > 32; - }, - }, -}; + }; </script> <template> <div class="mr-source-target"> |