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) {
|
} else if (Meteor.isServer) {
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
if (!Docs.findOne()) {
|
if (!Docs.findOne()) {
|
||||||
Assets.getText('docs/defaultDocs.json', (string) => {
|
Assets.getText('docs/defaultDocs.json', (error, string) => {
|
||||||
const docs = JSON.parse(string)
|
const docs = JSON.parse(string)
|
||||||
docs.forEach(doc => Docs.insert(doc));
|
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';
|
import Vue from 'vue';
|
||||||
// Global components
|
// Global components
|
||||||
import DatePicker from '/imports/client/ui/components/global/DatePicker.vue';
|
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 IconPicker from '/imports/client/ui/components/global/IconPicker.vue';
|
||||||
import TextField from '/imports/client/ui/components/global/TextField.vue';
|
import TextField from '/imports/client/ui/components/global/TextField.vue';
|
||||||
import TextArea from '/imports/client/ui/components/global/TextArea.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';
|
import SmartSlider from '/imports/client/ui/components/global/SmartSlider.vue';
|
||||||
|
|
||||||
Vue.component('DatePicker', DatePicker);
|
Vue.component('DatePicker', DatePicker);
|
||||||
|
Vue.component('DragHandle', DragHandle);
|
||||||
Vue.component('IconPicker', IconPicker);
|
Vue.component('IconPicker', IconPicker);
|
||||||
Vue.component('TextField', TextField);
|
Vue.component('TextField', TextField);
|
||||||
Vue.component('TextArea', TextArea);
|
Vue.component('TextArea', TextArea);
|
||||||
|
|||||||
@@ -30,14 +30,12 @@
|
|||||||
:class="{'ml-4': startExpanded}"
|
:class="{'ml-4': startExpanded}"
|
||||||
style="flex-grow: 0;"
|
style="flex-grow: 0;"
|
||||||
>
|
>
|
||||||
<v-icon
|
<drag-handle
|
||||||
v-if="organize"
|
v-if="organize"
|
||||||
class="handle mr-2"
|
class="mr-2"
|
||||||
:class="selected && 'primary--text'"
|
:class="selected && 'primary--text'"
|
||||||
:disabled="expanded"
|
:disabled="expanded"
|
||||||
>
|
/>
|
||||||
mdi-drag
|
|
||||||
</v-icon>
|
|
||||||
<!--{{node && node.order}}-->
|
<!--{{node && node.order}}-->
|
||||||
<tree-node-view
|
<tree-node-view
|
||||||
:model="node"
|
:model="node"
|
||||||
@@ -177,10 +175,6 @@ export default {
|
|||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.handle {
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty .drag-area {
|
.empty .drag-area {
|
||||||
box-shadow: -2px 0px 0px 0px rgb(128, 128, 128, 0.4);
|
box-shadow: -2px 0px 0px 0px rgb(128, 128, 128, 0.4);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
v-model="displayedChildren"
|
v-model="displayedChildren"
|
||||||
class="drag-area"
|
class="drag-area"
|
||||||
:group="group"
|
:group="group"
|
||||||
:move="move"
|
|
||||||
:animation="200"
|
:animation="200"
|
||||||
ghost-class="ghost"
|
ghost-class="ghost"
|
||||||
draggable=".item"
|
draggable=".item"
|
||||||
@@ -27,7 +26,6 @@
|
|||||||
@selected="e => $emit('selected', e)"
|
@selected="e => $emit('selected', e)"
|
||||||
@reordered="e => $emit('reordered', e)"
|
@reordered="e => $emit('reordered', e)"
|
||||||
@reorganized="e => $emit('reorganized', e)"
|
@reorganized="e => $emit('reorganized', e)"
|
||||||
@dragstart.native="e => e.dataTransfer.setData('cow', child.node && child.node.name)"
|
|
||||||
/>
|
/>
|
||||||
</draggable>
|
</draggable>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -40,12 +40,9 @@
|
|||||||
<shared-icon :model="model" />
|
<shared-icon :model="model" />
|
||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
<v-list-item-action v-if="!selection && !dense">
|
<v-list-item-action v-if="!selection && !dense">
|
||||||
<v-icon
|
<drag-handle
|
||||||
style="height: 100%; width: 40px; cursor: move;"
|
style="height: 100%; width: 40px;"
|
||||||
class="handle"
|
/>
|
||||||
>
|
|
||||||
mdi-drag
|
|
||||||
</v-icon>
|
|
||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -33,13 +33,10 @@
|
|||||||
/>
|
/>
|
||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
<v-list-item-action class="drag-handle">
|
<v-list-item-action class="drag-handle">
|
||||||
<v-icon
|
<drag-handle
|
||||||
:disabled="context.editPermission === false"
|
:disabled="context.editPermission === false"
|
||||||
style="height: 100%; width: 40px; cursor: move;"
|
style="height: 100%; width: 40px; cursor: move;"
|
||||||
class="handle"
|
/>
|
||||||
>
|
|
||||||
mdi-drag
|
|
||||||
</v-icon>
|
|
||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -29,14 +29,11 @@
|
|||||||
@click.native.stop="() => {}"
|
@click.native.stop="() => {}"
|
||||||
@change="setPrepared"
|
@change="setPrepared"
|
||||||
/>
|
/>
|
||||||
<v-icon
|
<drag-handle
|
||||||
v-else-if="!hideHandle"
|
v-else-if="!hideHandle"
|
||||||
:disabled="context.editPermission === false"
|
:disabled="context.editPermission === false"
|
||||||
style="height: 100%; width: 40px; cursor: move;"
|
style="height: 100%; width: 40px; cursor: move;"
|
||||||
class="handle"
|
/>
|
||||||
>
|
|
||||||
mdi-drag
|
|
||||||
</v-icon>
|
|
||||||
<v-btn
|
<v-btn
|
||||||
v-else-if="showInfoButton"
|
v-else-if="showInfoButton"
|
||||||
icon
|
icon
|
||||||
|
|||||||
Reference in New Issue
Block a user