Recalculate change offsets on editor resize

This commit is contained in:
James Allen 2016-10-13 12:09:18 +01:00
parent 8d968f6865
commit 77c02042f8

View file

@ -9,7 +9,6 @@ define [
@changesTracker = new ChangesTracker()
@changeIdToMarkerIdMap = {}
@enabled = false
console.log "Track Changes", @$scope.reviewPanel
@changesTracker.on "insert:added", (change) =>
@_onInsertAdded(change)
@ -28,17 +27,14 @@ define [
setTimeout () =>
@checkMapping()
, 100
# onScroll = () =>
# @recalculateReviewEntriesScreenPositions()
@editor.on "changeSession", (e) =>
e.oldSession?.getDocument().off "change", onChange
e.session.getDocument().on "change", onChange
# e.oldSession?.off "changeScrollTop", onScroll
# e.session.on "changeScrollTop", onScroll
@editor.getSession().getDocument().on "change", onChange
# @editor.getSession().on "changeScrollTop", onScroll
@editor.renderer.on "resize", () =>
@recalculateReviewEntriesScreenPositions()
checkMapping: () ->
session = @editor.getSession()