Commit eb04b218 authored by christianrhansen's avatar christianrhansen

create empty cell clone on touch-hold. context menu grid now dektop only.

parent f3ee8c18
Pipeline #16534 passed with stage
in 4 minutes and 56 seconds
......@@ -27,8 +27,8 @@
@contextmenu="handleGridContextMenu",
:style="gridStyle")
// context menu grid
q-context-menu(ref="gridmenu")
// context menu grid (desktop only)
q-context-menu.desktop-only(ref="gridmenu")
q-list(link, separator, no-border, style="min-width: 150px; max-height: 300px;")
q-item(
v-for="action in gridContextMenuActions",
......@@ -44,6 +44,7 @@
//----- cell
.cell-item(
v-if="!annotationUIStates[annotation._uuid] || !annotationUIStates[annotation._uuid].beingDragged",
v-touch-hold="event => {cellHold(event, annotation)}",
draggable="true",
@click.prevent="event => {handleCellTouch(event, annotation)}",
@dragstart="event => {handleCellDragStart(event, annotation)}",
......@@ -317,6 +318,21 @@
}
},
methods: {
async cellHold (event, annotation) {
this.$q.notify({
message: 'Cell was cloned.',
color: 'dark',
textColor: 'white'
})
const _cell = await this.$store.dispatch('cells/get', annotation.body.source.id)
const resourceCell = {
data: { content: '' },
config: {},
component: _cell.component
}
this.$store.commit('mosys/cacheNewCell', resourceCell)
},
moveCachedCell (obj) {
this.touch.position = {top: obj.position.top, left: obj.position.left}
/*
......
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