mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Open current selection when leaving track changes
This commit is contained in:
parent
ac0f05a9e4
commit
5dd3f828e3
2 changed files with 15 additions and 7 deletions
|
@ -70,6 +70,12 @@ define [
|
|||
entity.selected = false
|
||||
entity.selected = true
|
||||
|
||||
findSelectedEntity: () ->
|
||||
selected = null
|
||||
@forEachEntity (entity) ->
|
||||
selected = entity if entity.selected
|
||||
return selected
|
||||
|
||||
findEntityById: (id, options = {}) ->
|
||||
return @$scope.rootFolder if @$scope.rootFolder.id == id
|
||||
|
||||
|
|
|
@ -9,10 +9,9 @@ define [
|
|||
|
||||
@$scope.toggleTrackChanges = () =>
|
||||
if @$scope.ui.view == "track-changes"
|
||||
@$scope.ui.view = "editor"
|
||||
@hide()
|
||||
else
|
||||
@$scope.ui.view = "track-changes"
|
||||
@onShow()
|
||||
@show()
|
||||
|
||||
@$scope.$watch "trackChanges.selection.updates", (updates) =>
|
||||
if updates? and updates.length > 0
|
||||
|
@ -24,11 +23,14 @@ define [
|
|||
@$scope.trackChanges.selection.doc = entity
|
||||
@reloadDiff()
|
||||
|
||||
onShow: () ->
|
||||
show: () ->
|
||||
@$scope.ui.view = "track-changes"
|
||||
@reset()
|
||||
# @fetchNextBatchOfChanges()
|
||||
# .success () =>
|
||||
# @autoSelectRecentUpdates()
|
||||
|
||||
hide: () ->
|
||||
@$scope.ui.view = "editor"
|
||||
# Make sure we run the 'open' logic for whatever is currently selected
|
||||
@$scope.$emit "entity:selected", @ide.fileTreeManager.findSelectedEntity()
|
||||
|
||||
reset: () ->
|
||||
@$scope.trackChanges = {
|
||||
|
|
Loading…
Reference in a new issue