Merge branch 'version-2-dev' of https://github.com/ThaumRystra/DiceCloud into version-2-dev
This commit is contained in:
@@ -145,7 +145,7 @@ if (Meteor.isClient) {
|
||||
} else if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
if (!Docs.findOne()) {
|
||||
Assets.getText('docs/defaultDocs.json', (string) => {
|
||||
Assets.getText('docs/defaultDocs.json', (error, string) => {
|
||||
const docs = JSON.parse(string)
|
||||
docs.forEach(doc => Docs.insert(doc));
|
||||
});
|
||||
|
||||
45
app/imports/client/ui/components/global/DragHandle.vue
Normal file
45
app/imports/client/ui/components/global/DragHandle.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<v-icon
|
||||
class="handle"
|
||||
v-bind="$attrs"
|
||||
@click.stop="() => { }"
|
||||
@touchstart.native.stop="() => { }"
|
||||
@touchend.native="portalEvent"
|
||||
>
|
||||
mdi-drag
|
||||
</v-icon>
|
||||
</template>
|
||||
|
||||
<script lang="js">
|
||||
import { defer } from 'lodash'
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
portalEvent(e) {
|
||||
// Stop everything in the document listening for this touch event
|
||||
e.stopPropagation();
|
||||
// But also send it to straight to the root for draggable.js
|
||||
defer(() => {
|
||||
e.target.ownerDocument.dispatchEvent(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.handle {
|
||||
cursor: move !important;
|
||||
cursor: -webkit-grab !important;
|
||||
}
|
||||
.handle::after {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.sortable-drag.handle {
|
||||
cursor: move !important;
|
||||
cursor: -webkit-grabbing !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
// Global components
|
||||
import DatePicker from '/imports/client/ui/components/global/DatePicker.vue';
|
||||
import DragHandle from '/imports/client/ui/components/global/DragHandle.vue';
|
||||
import IconPicker from '/imports/client/ui/components/global/IconPicker.vue';
|
||||
import TextField from '/imports/client/ui/components/global/TextField.vue';
|
||||
import TextArea from '/imports/client/ui/components/global/TextArea.vue';
|
||||
@@ -13,6 +14,7 @@ import SvgIcon from '/imports/client/ui/components/global/SvgIcon.vue';
|
||||
import SmartSlider from '/imports/client/ui/components/global/SmartSlider.vue';
|
||||
|
||||
Vue.component('DatePicker', DatePicker);
|
||||
Vue.component('DragHandle', DragHandle);
|
||||
Vue.component('IconPicker', IconPicker);
|
||||
Vue.component('TextField', TextField);
|
||||
Vue.component('TextArea', TextArea);
|
||||
|
||||
@@ -30,14 +30,12 @@
|
||||
:class="{'ml-4': startExpanded}"
|
||||
style="flex-grow: 0;"
|
||||
>
|
||||
<v-icon
|
||||
<drag-handle
|
||||
v-if="organize"
|
||||
class="handle mr-2"
|
||||
class="mr-2"
|
||||
:class="selected && 'primary--text'"
|
||||
:disabled="expanded"
|
||||
>
|
||||
mdi-drag
|
||||
</v-icon>
|
||||
/>
|
||||
<!--{{node && node.order}}-->
|
||||
<tree-node-view
|
||||
:model="node"
|
||||
@@ -177,10 +175,6 @@ export default {
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.empty .drag-area {
|
||||
box-shadow: -2px 0px 0px 0px rgb(128, 128, 128, 0.4);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
v-model="displayedChildren"
|
||||
class="drag-area"
|
||||
:group="group"
|
||||
:move="move"
|
||||
:animation="200"
|
||||
ghost-class="ghost"
|
||||
draggable=".item"
|
||||
@@ -27,7 +26,6 @@
|
||||
@selected="e => $emit('selected', e)"
|
||||
@reordered="e => $emit('reordered', e)"
|
||||
@reorganized="e => $emit('reorganized', e)"
|
||||
@dragstart.native="e => e.dataTransfer.setData('cow', child.node && child.node.name)"
|
||||
/>
|
||||
</draggable>
|
||||
</template>
|
||||
|
||||
@@ -40,12 +40,9 @@
|
||||
<shared-icon :model="model" />
|
||||
</v-list-item-action>
|
||||
<v-list-item-action v-if="!selection && !dense">
|
||||
<v-icon
|
||||
style="height: 100%; width: 40px; cursor: move;"
|
||||
class="handle"
|
||||
>
|
||||
mdi-drag
|
||||
</v-icon>
|
||||
<drag-handle
|
||||
style="height: 100%; width: 40px;"
|
||||
/>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
</template>
|
||||
|
||||
@@ -33,13 +33,10 @@
|
||||
/>
|
||||
</v-list-item-action>
|
||||
<v-list-item-action class="drag-handle">
|
||||
<v-icon
|
||||
<drag-handle
|
||||
:disabled="context.editPermission === false"
|
||||
style="height: 100%; width: 40px; cursor: move;"
|
||||
class="handle"
|
||||
>
|
||||
mdi-drag
|
||||
</v-icon>
|
||||
/>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
</template>
|
||||
|
||||
@@ -29,14 +29,11 @@
|
||||
@click.native.stop="() => {}"
|
||||
@change="setPrepared"
|
||||
/>
|
||||
<v-icon
|
||||
<drag-handle
|
||||
v-else-if="!hideHandle"
|
||||
:disabled="context.editPermission === false"
|
||||
style="height: 100%; width: 40px; cursor: move;"
|
||||
class="handle"
|
||||
>
|
||||
mdi-drag
|
||||
</v-icon>
|
||||
/>
|
||||
<v-btn
|
||||
v-else-if="showInfoButton"
|
||||
icon
|
||||
|
||||
Reference in New Issue
Block a user