Skip to content

Commit

Permalink
Merge pull request #271 from voxmedia/paste-scroll-v2
Browse files Browse the repository at this point in the history
Fix paste-manager scrollIntoView() behavior
  • Loading branch information
jhchen committed Dec 4, 2014
2 parents a18b142 + d6dee28 commit 31b6d56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/paste-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class PasteManager
@quill.setSelection(range.start + lengthAdded, range.start + lengthAdded)
# Make sure bottom of pasted content is visible
[line, offset] = @quill.editor.doc.findLineAt(range.start + lengthAdded)
lineBottom = line.node.offsetTop + line.node.offsetHeight
editorBottom = @quill.container.scrollTop + @quill.container.offsetHeight
line.node.scrollIntoView(false) if lineBottom > editorBottom
lineBottom = line.node.getBoundingClientRect().bottom
windowBottom = document.documentElement.clientHeight
line.node.scrollIntoView(false) if lineBottom > windowBottom
@container.innerHTML = ""
)

Expand Down

0 comments on commit 31b6d56

Please sign in to comment.