From 6491beacb3ef9b0b837e9198a26d831d2aee9352 Mon Sep 17 00:00:00 2001 From: christianrhansen Date: Wed, 6 Nov 2019 12:36:22 +0100 Subject: [PATCH] mosys mobile: "edit cell"-button in "selected cell header" only. added functionality. --- partials/GridEditor.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/partials/GridEditor.vue b/partials/GridEditor.vue index 0cd0b9c..34ec670 100644 --- a/partials/GridEditor.vue +++ b/partials/GridEditor.vue @@ -33,10 +33,10 @@ strong {{ selectedCell.type }} q-item-side.row - q-btn.text-white.q-px-sm(@click="", flat) + q-btn.text-white.q-px-sm(@click="event => {handleCellInfoTouch(event, selectedCell.annotation)}", flat) q-icon(name="edit") - q-btn.text-white.q-px-sm(@click="event => {handleCellContextMenuDelete(event, mobileSelectedCell)}", + q-btn.text-white.q-px-sm.on-right.on-left(@click="event => {handleCellContextMenuDelete(event, mobileSelectedCell)}", flat) q-icon(name="delete") @@ -110,11 +110,12 @@ v-touch-hold="event => {handleCellInfoTouch(event, annotation)}", @click.prevent="event => {touchMobileCell(event, annotation)}") - q-btn.absolute-top-right.text-dark.q-pa-none.q-mr-xs( - v-if="showEditingCells", - @click.prevent="event => {handleCellInfoTouch(event, annotation)}", - flat, round, size="sm", style="margin-top: 2px;") - q-icon(name="edit", size="20px") + // + q-btn.absolute-top-right.text-dark.q-pa-none.q-mr-xs( + v-if="showEditingCells", + @click.prevent="event => {handleCellInfoTouch(event, annotation)}", + flat, round, size="sm", style="margin-top: 2px;") + q-icon(name="edit", size="20px") //----- invisible edit-modal handler // @@ -372,7 +373,7 @@ move: {left: undefined, intersectingMainHandler: false, side: undefined}, resize: {left: undefined, intersectingMainHandler: false, side: undefined} }, - selectedCell: {type: undefined} + selectedCell: {type: undefined, annotation: undefined} } }, computed: { @@ -590,6 +591,7 @@ this.clearTempCell() }, handleCellInfoTouch (event, annotation) { + console.log('handleCellInfoTouch', annotation) this.touchMobileCell(event, annotation) this.handleModal() }, @@ -681,7 +683,7 @@ } }, touchMobileCell (event, cell) { - if (!this.mobileTempCell.onGrid) { + if (!this.mobileTempCell.onGrid && cell) { Object.keys(this.annotationUIStates).filter((k) => { if (k === cell._uuid && this.annotationUIStates[k].editing) console.log(k, cell._uuid) else this.annotationUIStates[k].editing = false @@ -693,6 +695,7 @@ } }, handleCellTouch (event, annotation) { + console.log('handleCellTouch', annotation) if (!this.cachedNewCell) { let parsed = annotation.target.selector.parse(), -- GitLab