mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-04 08:55:47 +00:00
Merge pull request #8373 from overleaf/td-review-panel-scroll
Scroll incrementally in response to mouse wheel in review panel GitOrigin-RevId: 2c1f119ae8dfd09b378a3b265c3543f88e2d1f65
This commit is contained in:
parent
93f1339b87
commit
ca5f438290
1 changed files with 4 additions and 4 deletions
|
@ -255,7 +255,7 @@ export default App.directive('reviewPanelSorted', $timeout => ({
|
|||
const old_top = parseInt(list.css('top'))
|
||||
const top = old_top - deltaY * 4
|
||||
scrollAce(-top)
|
||||
dispatchScrollEvent(-top)
|
||||
dispatchScrollEvent(deltaY * 4)
|
||||
return e.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -287,11 +287,11 @@ export default App.directive('reviewPanelSorted', $timeout => ({
|
|||
scrollPanel(scrollTop - paddingTop, height)
|
||||
})
|
||||
|
||||
// send the scroll position to the CodeMirror 6 track changes extension
|
||||
const dispatchScrollEvent = value => {
|
||||
// Send scroll delta to the CodeMirror 6 track changes extension
|
||||
const dispatchScrollEvent = scrollTopDelta => {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('review-panel:event', {
|
||||
detail: { type: 'scroll', payload: value },
|
||||
detail: { type: 'scroll', payload: scrollTopDelta },
|
||||
})
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue