mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Load history view using mainAreaManager
This commit is contained in:
parent
9fa80ad757
commit
b99eaecf82
2 changed files with 4 additions and 25 deletions
|
@ -351,10 +351,3 @@ define [
|
||||||
|
|
||||||
getCurrentDocId: () ->
|
getCurrentDocId: () ->
|
||||||
@current_doc_id
|
@current_doc_id
|
||||||
|
|
||||||
show: () ->
|
|
||||||
$("#editor").show()
|
|
||||||
|
|
||||||
hide: () ->
|
|
||||||
$("#editor").hide()
|
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,9 @@ define [
|
||||||
constructor: (@ide) ->
|
constructor: (@ide) ->
|
||||||
@project_id = window.userSettings.project_id
|
@project_id = window.userSettings.project_id
|
||||||
@$el = $(@template)
|
@$el = $(@template)
|
||||||
$("#editorWrapper").append(@$el)
|
@ide.mainAreaManager.addArea
|
||||||
@hideEl()
|
identifier: "trackChanges"
|
||||||
|
element: @$el
|
||||||
@ide.editor.on "change:doc", () =>
|
|
||||||
@hideEl()
|
|
||||||
|
|
||||||
@ide.editor.on "resize", () =>
|
@ide.editor.on "resize", () =>
|
||||||
@diffView?.resize()
|
@diffView?.resize()
|
||||||
|
@ -58,10 +56,9 @@ define [
|
||||||
if @diffView?
|
if @diffView?
|
||||||
@diffView.destroy()
|
@diffView.destroy()
|
||||||
|
|
||||||
@showEl()
|
@ide.mainAreaManager.change "trackChanges"
|
||||||
|
|
||||||
hide: () ->
|
hide: () ->
|
||||||
@hideEl()
|
|
||||||
@ide.fileTreeManager.openDoc(@doc_id)
|
@ide.fileTreeManager.openDoc(@doc_id)
|
||||||
|
|
||||||
autoSelectDiff: () ->
|
autoSelectDiff: () ->
|
||||||
|
@ -113,9 +110,7 @@ define [
|
||||||
to = null
|
to = null
|
||||||
|
|
||||||
for change in @changes.models.slice(toIndex, fromIndex + 1)
|
for change in @changes.models.slice(toIndex, fromIndex + 1)
|
||||||
console.log "considering change"
|
|
||||||
for doc in change.get("docs")
|
for doc in change.get("docs")
|
||||||
console.log "considering doc", doc.id, doc_id
|
|
||||||
if doc.id == doc_id
|
if doc.id == doc_id
|
||||||
if from? and to?
|
if from? and to?
|
||||||
from = Math.min(from, doc.fromV)
|
from = Math.min(from, doc.fromV)
|
||||||
|
@ -124,18 +119,9 @@ define [
|
||||||
from = doc.fromV
|
from = doc.fromV
|
||||||
to = doc.toV
|
to = doc.toV
|
||||||
break
|
break
|
||||||
console.log "Done", from, to
|
|
||||||
|
|
||||||
return {from, to}
|
return {from, to}
|
||||||
|
|
||||||
showEl: ->
|
|
||||||
@ide.editor.hide()
|
|
||||||
@$el.show()
|
|
||||||
|
|
||||||
hideEl: () ->
|
|
||||||
@ide.editor.show()
|
|
||||||
@$el.hide()
|
|
||||||
|
|
||||||
restore: (change) ->
|
restore: (change) ->
|
||||||
name = @ide.fileTreeManager.getNameOfEntityId(@doc_id)
|
name = @ide.fileTreeManager.getNameOfEntityId(@doc_id)
|
||||||
date = moment(change.get("start_ts")).format("Do MMM YYYY, h:mm:ss a")
|
date = moment(change.get("start_ts")).format("Do MMM YYYY, h:mm:ss a")
|
||||||
|
|
Loading…
Reference in a new issue