Skip to content

Commit

Permalink
Add wheelSensitivity prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Cheng committed Jan 4, 2024
1 parent ceef1dd commit bb60f26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue-excel-editor",
"email": "apple.6502@gmail.com",
"description": "Vue2 plugin for displaying and editing the array-of-object in Excel style",
"version": "1.5.19",
"version": "1.5.20",
"main": "src/main.js",
"dependencies": {
"vue2-datepicker": "^3.3.0",
Expand Down
7 changes: 4 additions & 3 deletions src/VueExcelEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ export default {
nFilterCount: {type: Number, default: 1000}, // show top n values in filter dialog
height: {type: String, default: ''},
width: {type: String, default: '100%'},
wheelSensitivity: {type: Number, default: 30},
autocomplete: {type: Boolean, default: false}, // Default autocomplete of all columns
autocompleteCount: {type: Number, default: 50},
readonly: {type: Boolean, default: false},
Expand Down Expand Up @@ -467,7 +468,7 @@ export default {
summaryRow: false,
summary: {},
showFilteredOnly: true,
showSelectedOnly: false
showSelectedOnly: false,
}
return dataset
},
Expand Down Expand Up @@ -1231,8 +1232,8 @@ export default {
mousewheel (e) {
if (this.noMouseScroll || !this.mousein || !e.deltaY) return
let adjust = 0
if (e.deltaY > 30 && this.pageTop + this.pageSize < this.table.length) adjust = 1
else if (e.deltaY < -30 && this.pageTop > 0) adjust = -1
if (e.deltaY > 1 * this.wheelSensitivity && this.pageTop + this.pageSize < this.table.length) adjust = 1
else if (e.deltaY < -1 * this.wheelSensitivity && this.pageTop > 0) adjust = -1
if (adjust) {
this.pageTop += adjust
setTimeout(this.calVScroll)
Expand Down

0 comments on commit bb60f26

Please sign in to comment.