summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/components/board_card.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/boards/components/board_card.vue')
-rw-r--r--app/assets/javascripts/boards/components/board_card.vue130
1 files changed, 65 insertions, 65 deletions
diff --git a/app/assets/javascripts/boards/components/board_card.vue b/app/assets/javascripts/boards/components/board_card.vue
index 33e3369b971..0398102ad02 100644
--- a/app/assets/javascripts/boards/components/board_card.vue
+++ b/app/assets/javascripts/boards/components/board_card.vue
@@ -1,83 +1,82 @@
<script>
-/* eslint-disable vue/require-default-prop */
-import './issue_card_inner';
-import eventHub from '../eventhub';
+ /* eslint-disable vue/require-default-prop */
+ import IssueCardInner from './issue_card_inner.vue';
+ import eventHub from '../eventhub';
-const Store = gl.issueBoards.BoardsStore;
+ const Store = gl.issueBoards.BoardsStore;
-export default {
- name: 'BoardsIssueCard',
- components: {
- 'issue-card-inner': gl.issueBoards.IssueCardInner,
- },
- props: {
- list: {
- type: Object,
- default: () => ({}),
+ export default {
+ name: 'BoardsIssueCard',
+ components: {
+ IssueCardInner,
},
- issue: {
- type: Object,
- default: () => ({}),
+ props: {
+ list: {
+ type: Object,
+ default: () => ({}),
+ },
+ issue: {
+ type: Object,
+ default: () => ({}),
+ },
+ issueLinkBase: {
+ type: String,
+ default: '',
+ },
+ disabled: {
+ type: Boolean,
+ default: false,
+ },
+ index: {
+ type: Number,
+ default: 0,
+ },
+ rootPath: {
+ type: String,
+ default: '',
+ },
+ groupId: {
+ type: Number,
+ },
},
- issueLinkBase: {
- type: String,
- default: '',
+ data() {
+ return {
+ showDetail: false,
+ detailIssue: Store.detail,
+ };
},
- disabled: {
- type: Boolean,
- default: false,
+ computed: {
+ issueDetailVisible() {
+ return this.detailIssue.issue && this.detailIssue.issue.id === this.issue.id;
+ },
},
- index: {
- type: Number,
- default: 0,
- },
- rootPath: {
- type: String,
- default: '',
- },
- groupId: {
- type: Number,
- },
- },
- data() {
- return {
- showDetail: false,
- detailIssue: Store.detail,
- };
- },
- computed: {
- issueDetailVisible() {
- return this.detailIssue.issue && this.detailIssue.issue.id === this.issue.id;
- },
- },
- methods: {
- mouseDown() {
- this.showDetail = true;
- },
- mouseMove() {
- this.showDetail = false;
- },
- showIssue(e) {
- if (e.target.classList.contains('js-no-trigger')) return;
-
- if (this.showDetail) {
+ methods: {
+ mouseDown() {
+ this.showDetail = true;
+ },
+ mouseMove() {
this.showDetail = false;
+ },
+ showIssue(e) {
+ if (e.target.classList.contains('js-no-trigger')) return;
+
+ if (this.showDetail) {
+ this.showDetail = false;
- if (Store.detail.issue && Store.detail.issue.id === this.issue.id) {
- eventHub.$emit('clearDetailIssue');
- } else {
- eventHub.$emit('newDetailIssue', this.issue);
- Store.detail.list = this.list;
+ if (Store.detail.issue && Store.detail.issue.id === this.issue.id) {
+ eventHub.$emit('clearDetailIssue');
+ } else {
+ eventHub.$emit('newDetailIssue', this.issue);
+ Store.detail.list = this.list;
+ }
}
- }
+ },
},
- },
-};
+ };
</script>
<template>
<li
- class="board-card"
:class="{
'user-can-drag': !disabled && issue.id,
'is-disabled': disabled || !issue.id,
@@ -85,6 +84,7 @@ export default {
}"
:index="index"
:data-issue-id="issue.id"
+ class="board-card"
@mousedown="mouseDown"
@mousemove="mouseMove"
@mouseup="showIssue($event)">