Skip to content

Commit

Permalink
#805: tidy up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mulholland committed Jun 6, 2018
1 parent b2c6a73 commit 33ad9d5
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions src/renderer/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,53 +477,19 @@ export default {
}
return element
},
// addErrorHoverCellRenderer: function(row, col) {
// return this.addCellRenderer(row, col, this.errorHoverHtmlRenderer)
// },
// addErrorCellRenderer: function(row, col) {
// return this.addCellRenderer(row, col, this.errorHtmlRenderer)
// },
// addCellRenderer: function(row, col, rendererFn) {
// return {row: row, col: col, renderer: rendererFn}
// },
// removeCellRenderer: function(row, col) {
// return {row: row, col: col}
// },
// updateCellsFromCount: function(row, column, rendererFn) {
// let hot = HotRegister.getActiveInstance()
// // to and from row will be equal so iterate through cols
// let range = this.getCellOrRowFromCount(hot, row, column)
// const updates = []
// for (let index = range.from.col; index <= range.to.col; index++) {
// updates.push(rendererFn(range.from.row, index))
// }
// hot.updateSettings({cell: updates})
// },
updateCellsFromCount: function(row, column, fn) {
let hot = HotRegister.getActiveInstance()
let range = this.getCellOrRowFromCount(hot, row, column)
this.updateCellsFromHotRange(hot, range, fn)
},
updateCellsFromIndex: function(row, column, fn) {
let hot = HotRegister.getActiveInstance()
let range = this.getCellOrRowFromIndex(hot, row, column)
this.updateCellsFromHotRange(hot, range, fn)
},
updateCellsFromHotRange: function(hot, range, fn) {
console.log('inside update cells from hot range')
console.time('updateCells')
// before we select cell for errors, check if there is a current selection made
hot.selectCell(range.from.row, range.from.col, range.to.row, range.to.col)
let elements = this.getHighlightedAreaOrCellSelectors()
hot.deselectCell()
console.timeEnd('updateCells')
// console.log('applying update cells function...', fn)
console.time('applyColour')
for (let element of elements) {
fn(element)
}
console.timeEnd('applyColour')
// hot.deselectCell()
},
getHighlightedAreaOrCellSelectors: function() {
Expand Down Expand Up @@ -582,30 +548,12 @@ export default {
}
const hot = HotRegister.getInstance(this.currentHotId)
this.setHotComments(hot)
// console.time('set comments render')
hot.updateSettings({cell: this.previousComments})
// console.timeEnd('set comments render')
// console.timeEnd('startIteration')
},
errorHtmlRenderer: function(instance, td, row, col, prop, value, cellProperties) {
td.style.backgroundColor = this.errorColor
return td
},
errorHoverHtmlRenderer: function(instance, td, row, col, prop, value, cellProperties) {
this.addErrorHoverStyle(td)
return td
},
highlightHtmlRenderer: function(instance, td, row, col, prop, value, cellProperties) {
td.style.backgroundColor = this.highlightColor
return td
},
unHighlightHtmlRenderer: function(instance, td, row, col, prop, value, cellProperties) {
if (td.style.backgroundColor === this.highlightColor) {
_.unset(td.style, 'backgroundColor')
// td.style.backgroundColor = ''
}
return td
},
validateTable: async function() {
try {
// console.time('startIteration')
Expand Down Expand Up @@ -971,9 +919,6 @@ export default {
}
},
removePreviousHotComments: function(hot) {
// for (const element of document.querySelectorAll('.htCommentCell')) {
// this.removeErrorHighlightStyle(element)
// }
for (const previousComment of this.previousComments) {
_.unset(previousComment, 'comment')
_.unset(previousComment, 'renderer')
Expand Down

0 comments on commit 33ad9d5

Please sign in to comment.