Commit 25363337 authored by Clement Ho's avatar Clement Ho Committed by Jarka Kadlecová

Add sortable styles

parent 6dce2963
...@@ -43,6 +43,11 @@ export default { ...@@ -43,6 +43,11 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
canReorder: {
type: Boolean,
required: false,
default: false,
},
isCondensed: { isCondensed: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -116,6 +121,7 @@ export default { ...@@ -116,6 +121,7 @@ export default {
:class="{ :class="{
'issue-token-link': isCondensed, 'issue-token-link': isCondensed,
'issue-main-info': !isCondensed, 'issue-main-info': !isCondensed,
'sortable-link': canReorder
}" }"
:href="computedPath" :href="computedPath"
:title="issueTitle" :title="issueTitle"
...@@ -162,7 +168,7 @@ export default { ...@@ -162,7 +168,7 @@ export default {
v-tooltip v-tooltip
ref="removeButton" ref="removeButton"
type="button" type="button"
class="js-issue-token-remove-button flex-right sortable-hidden" class="js-issue-token-remove-button flex-right"
:class="{ :class="{
'issue-token-remove-button': isCondensed, 'issue-token-remove-button': isCondensed,
'btn btn-default': !isCondensed 'btn btn-default': !isCondensed
......
...@@ -101,8 +101,10 @@ export default { ...@@ -101,8 +101,10 @@ export default {
if (this.canReorder) { if (this.canReorder) {
this.sortable = Sortable.create(this.$refs.list, { this.sortable = Sortable.create(this.$refs.list, {
animation: 200, animation: 200,
forceFallback: true,
fallbackClass: 'is-dragging',
fallbackOnBody: true,
ghostClass: 'is-ghost', ghostClass: 'is-ghost',
chosenClass: "sortable-chosen",
onEnd: this.reordered, onEnd: this.reordered,
}); });
} }
...@@ -164,7 +166,8 @@ export default { ...@@ -164,7 +166,8 @@ export default {
<div <div
class="related-issues-token-body panel-body" class="related-issues-token-body panel-body"
:class="{ :class="{
'collapsed': !shouldShowTokenBody 'collapsed': !shouldShowTokenBody,
'sortable-container': canReorder
}"> }">
<div <div
v-if="isFetching" v-if="isFetching"
...@@ -175,13 +178,18 @@ export default { ...@@ -175,13 +178,18 @@ export default {
</div> </div>
<ul <ul
ref="list" ref="list"
class="flex-list content-list issuable-list" class="flex-list issuable-list"
:class="{ 'content-list' : !canReorder }"
> >
<li <li
:key="issue.id" :key="issue.id"
v-for="issue in relatedIssues" v-for="issue in relatedIssues"
class="js-related-issues-token-list-item" class="js-related-issues-token-list-item "
:class="{ 'is-dragging': canReorder }" :class="{
'user-can-drag': canReorder,
'sortable-row': canReorder,
card: canReorder
}"
> >
<issue-token <issue-token
event-namespace="relatedIssue" event-namespace="relatedIssue"
...@@ -191,6 +199,7 @@ export default { ...@@ -191,6 +199,7 @@ export default {
:path="issue.path" :path="issue.path"
:state="issue.state" :state="issue.state"
:can-remove="canAdmin" :can-remove="canAdmin"
:can-reorder="canReorder"
/> />
</li> </li>
</ul> </ul>
......
.sortable-chosen .sortable-hidden { .sortable-container {
display: none; background-color: $gray-light;
.flex-list {
padding: 5px;
margin-bottom: 0;
}
}
.sortable-row {
.flex-row {
display: flex;
&.issue-info-container {
padding-right: 0;
}
}
.sortable-link {
color: black;
}
} }
...@@ -31,8 +31,9 @@ $token_spacing_bottom: 0.5em; ...@@ -31,8 +31,9 @@ $token_spacing_bottom: 0.5em;
opacity: 0; opacity: 0;
} }
li .issue-info-container { li:not(.card) .issue-info-container {
padding-left: $gl-padding; padding-left: $gl-padding;
padding-right: $gl-padding;
} }
a.issue-main-info:hover { a.issue-main-info:hover {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment