Skip to content

Commit

Permalink
#805: refactored for breaking changes up to hot 3.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mulholland committed Jun 5, 2018
1 parent 4869a49 commit f08bf41
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"escape-regexp": "^0.0.1",
"etl": "^0.5.12",
"fs-extra": "~5.0.0",
"handsontable": "^0.38.1",
"handsontable": "3.0.0",
"imports-loader": "^0.8.0",
"lodash": "^4.17.4",
"markdown-it": "^8.4.1",
Expand Down
15 changes: 11 additions & 4 deletions src/renderer/partials/FindReplace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ Vue.use(VueRx, {
let _lastRowIndicies = []
let _currentHotPos = [-1, -1]
let _previousSearchClear = true
// cannot access DEFAULT anymore - must copy (https://docs.handsontable.com/3.0.0/demo-searching.html#page-custom-callback)
const _defaultCallback = function(instance, row, col, data, testResult) {
instance.getCellMeta(row, col).isSearchResult = testResult
}
const _searchCallback = function(instance, row, col, value, result) {
// const defaultCallback = instance.getCallback()
if (!_previousSearchClear && _.indexOf(_lastRowIndicies, row) > -1) {
searchCallback.apply(this, arguments)
_defaultCallback.apply(this, arguments)
} else if (col === _currentHotPos[1]) {
searchCallback.apply(this, arguments)
_defaultCallback.apply(this, arguments)
}
}
Expand Down Expand Up @@ -339,12 +344,14 @@ export default {
},
hotSearch: function(hot) {
// TODO : add loading screen here
hot.search.query(this.findTextValue)
const search = hot.getPlugin('search')
search.query(this.findTextValue)
hot.render()
},
clearPreviousHotSearch: function(hot) {
_previousSearchClear = false
hot.search.query()
const search = hot.getPlugin('search')
search.query()
_previousSearchClear = true
},
// hotSift: function(data, headers) {
Expand Down
12 changes: 8 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4943,9 +4943,9 @@ handlebars@^4.0.1, handlebars@^4.0.3:
optionalDependencies:
uglify-js "^2.6"

handsontable@^0.38.1:
version "0.38.1"
resolved "https://registry.yarnpkg.com/handsontable/-/handsontable-0.38.1.tgz#b8829ef4a82c4aad7d09472b71b6b6aa19baa6ce"
handsontable@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/handsontable/-/handsontable-3.0.0.tgz#3e1ac839882439fc2f4f7498f5b75c98159a59b7"
dependencies:
moment "2.20.1"
numbro "1.11.0"
Expand Down Expand Up @@ -6961,7 +6961,11 @@ [email protected]:
version "2.20.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"

[email protected], moment@^2.21.0, moment@~2.21.0:
[email protected]:
version "2.22.2"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"

moment@^2.21.0, moment@~2.21.0:
version "2.21.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.21.0.tgz#2a114b51d2a6ec9e6d83cf803f838a878d8a023a"

Expand Down

0 comments on commit f08bf41

Please sign in to comment.