Commit 81b3462d authored by Anton's avatar Anton
Browse files

fix eslint problems

parent 2fe19a0b
...@@ -133,12 +133,12 @@ ...@@ -133,12 +133,12 @@
// that is wrapped into a cell-annotation // that is wrapped into a cell-annotation
const destUuid = cell.sourceUuid || cell.uuid const destUuid = cell.sourceUuid || cell.uuid
if (destUuid) { if (destUuid) {
this.$store.dispatch('annotations/find', {'uuid': destUuid}) this.$store.dispatch('annotations/find', { 'uuid': destUuid })
.then(annotations => { .then(annotations => {
const a = annotations.items.shift() const a = annotations.items.shift()
cell.content = value cell.content = value
a.body.value = JSON.stringify(cell) a.body.value = JSON.stringify(cell)
_this.$store.dispatch('annotations/patch', [destUuid, {body: a.body, target: a.target}]) _this.$store.dispatch('annotations/patch', [destUuid, { body: a.body, target: a.target }])
}) })
} }
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
annotations: [], annotations: [],
cells: [], cells: [],
gridMetadata: {}, gridMetadata: {},
gridDimensions: {gridWidth: 0, gridHeight: 0, cellWidth: 0, cellHeight: 0}, gridDimensions: { gridWidth: 0, gridHeight: 0, cellWidth: 0, cellHeight: 0 },
gridStyle: {}, gridStyle: {},
messenger: new MessengerComponent() messenger: new MessengerComponent()
} }
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
} }
}, },
getCellStyle (cell) { getCellStyle (cell) {
return {'grid-column-start': cell.x, 'grid-column-end': `span ${cell.width}`, 'grid-row-start': cell.y, 'grid-row-end': `span ${cell.height}`} return { 'grid-column-start': cell.x, 'grid-column-end': `span ${cell.width}`, 'grid-row-start': cell.y, 'grid-row-end': `span ${cell.height}` }
} }
} }
} }
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
cells: [], cells: [],
tmpCells: [], tmpCells: [],
cellUIStates: {}, cellUIStates: {},
gridDimensions: {gridWidth: 0, gridHeight: 0, cellWidth: 0, cellHeight: 0}, gridDimensions: { gridWidth: 0, gridHeight: 0, cellWidth: 0, cellHeight: 0 },
gridStyle: {}, gridStyle: {},
contextMenuClickPosition: {}, contextMenuClickPosition: {},
resizingGrid: false resizingGrid: false
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
}).shift() }).shift()
let offset, position let offset, position
if (!cell) { if (!cell) {
cell = {uuid: null, x: 1, y: 1, width: 1, height: 1} cell = { uuid: null, x: 1, y: 1, width: 1, height: 1 }
position = this.getGridPositionForEvent(event) position = this.getGridPositionForEvent(event)
} }
else { else {
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
} }
} }
this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, {columns: this.gridMetadata.columns + 1}) this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, { columns: this.gridMetadata.columns + 1 })
await this.updateGridMetadataStore() await this.updateGridMetadataStore()
}, },
async handleGridContextMenuDeleteColumn () { async handleGridContextMenuDeleteColumn () {
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
} }
} }
this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, {columns: this.gridMetadata.columns - 1}) this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, { columns: this.gridMetadata.columns - 1 })
await this.updateGridMetadataStore() await this.updateGridMetadataStore()
}, },
async handleGridContextMenuInsertRowAbove () { async handleGridContextMenuInsertRowAbove () {
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
await this.fetchCellAnnotations() await this.fetchCellAnnotations()
} }
} }
this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, {rows: this.gridMetadata.rows + 1}) this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, { rows: this.gridMetadata.rows + 1 })
await this.updateGridMetadataStore() await this.updateGridMetadataStore()
}, },
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
await this.fetchCellAnnotations() await this.fetchCellAnnotations()
} }
} }
this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, {rows: this.gridMetadata.rows - 1}) this.gridMetadata = ObjectUtil.merge({}, this.gridMetadata, { rows: this.gridMetadata.rows - 1 })
await this.updateGridMetadataStore() await this.updateGridMetadataStore()
}, },
...@@ -397,14 +397,14 @@ ...@@ -397,14 +397,14 @@
height: cell.height height: cell.height
} }
}, },
getGridPositionForEvent (event, offset = {x: 0, y: 0}) { getGridPositionForEvent (event, offset = { x: 0, y: 0 }) {
offset = {x: 0, y: 0} // TODO: remove quick fix offset = { x: 0, y: 0 } // TODO: remove quick fix
const elContainerBoundingBox = this.$el.getBoundingClientRect() const elContainerBoundingBox = this.$el.getBoundingClientRect()
const ox = event.clientX + this.$el.scrollLeft - elContainerBoundingBox.x - offset.x const ox = event.clientX + this.$el.scrollLeft - elContainerBoundingBox.x - offset.x
const oy = event.clientY + this.$el.scrollTop - elContainerBoundingBox.y - offset.y const oy = event.clientY + this.$el.scrollTop - elContainerBoundingBox.y - offset.y
const x = Math.ceil(ox / this.gridDimensions.full.cell.width) const x = Math.ceil(ox / this.gridDimensions.full.cell.width)
const y = Math.ceil(oy / this.gridDimensions.full.cell.height) const y = Math.ceil(oy / this.gridDimensions.full.cell.height)
return {x: x, y: y, ox: ox, oy: oy} return { x: x, y: y, ox: ox, oy: oy }
}, },
updateGridDimensions () { updateGridDimensions () {
let elWidth = this.$el.offsetWidth let elWidth = this.$el.offsetWidth
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
// TAGGING // TAGGING
else if (/^[\s]*#.+/.test(this.term)) { else if (/^[\s]*#.+/.test(this.term)) {
const tag = this.term.replace(/^[\s]*#/, '').toLowerCase() const tag = this.term.replace(/^[\s]*#/, '').toLowerCase()
_this.$store.dispatch('annotations/find', {'body.purpose': 'tagging'}) _this.$store.dispatch('annotations/find', { 'body.purpose': 'tagging' })
.then(tagAnnotations => { .then(tagAnnotations => {
console.log(tagAnnotations) console.log(tagAnnotations)
let targetsMatched = {} let targetsMatched = {}
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
results.push(res) results.push(res)
let body = ObjectUtil.merge({}, res.body) let body = ObjectUtil.merge({}, res.body)
body.type = 'text' body.type = 'text'
results.push({body}) results.push({ body })
} }
this.results = results this.results = results
} }
......
...@@ -71,10 +71,10 @@ ...@@ -71,10 +71,10 @@
methods: { methods: {
getSignature () { getSignature () {
if (this.video) { if (this.video) {
return {origin: this.video, type: 'Video'} return { origin: this.video, type: 'Video' }
} }
else { else {
return {origin: this.cell, type: '2DCell'} return { origin: this.cell, type: '2DCell' }
} }
}, },
handlePlayerReady (player) { handlePlayerReady (player) {
......
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