mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 13:02:03 +00:00
Move track changes activation into old history place
This commit is contained in:
parent
237f738650
commit
70da673bed
3 changed files with 28 additions and 16 deletions
|
@ -119,6 +119,8 @@ define [
|
|||
@analyticsManager = new AnalyticsManager(@)
|
||||
if @userSettings.trackChanges
|
||||
@trackChangesManager = new TrackChangesManager(@)
|
||||
else
|
||||
@historyManager = new HistoryManager(@)
|
||||
|
||||
@setLoadingMessage("Connecting")
|
||||
firstConnect = true
|
||||
|
@ -186,7 +188,6 @@ define [
|
|||
|
||||
_.extend(Ide::, Backbone.Events)
|
||||
window.ide = ide = new Ide()
|
||||
ide.historyManager = new HistoryManager ide
|
||||
ide.projectMembersManager = new ProjectMembersManager ide
|
||||
ide.settingsManager = new SettingsManager ide
|
||||
ide.helpManager = new HelpManager ide
|
||||
|
|
|
@ -12,26 +12,39 @@ define [
|
|||
@state = "closed"
|
||||
$("#toolbar").on "mouseenter", () => @onMouseOver()
|
||||
$("#toolbar").on "mouseleave", (e) => @onMouseOut(e)
|
||||
@tabs = []
|
||||
|
||||
addTab: (options) ->
|
||||
@tabs.push options
|
||||
|
||||
tabEl = $(Mustache.to_html @templates.tab, options)
|
||||
tabEl.find("a").attr("href", "#" + options.id)
|
||||
contentEl = $(Mustache.to_html @templates.content, options)
|
||||
contentEl.append(options.content)
|
||||
|
||||
if options.content?
|
||||
contentEl = $(Mustache.to_html @templates.content, options)
|
||||
contentEl.append(options.content)
|
||||
$("#tab-content").append(contentEl)
|
||||
|
||||
if options.active
|
||||
tabEl.addClass("active")
|
||||
contentEl.addClass("active")
|
||||
contentEl?.addClass("active")
|
||||
|
||||
if options.after?
|
||||
tabEl.insertAfter($("##{options.after}-tab-li"))
|
||||
else
|
||||
$("#tabs").append(tabEl)
|
||||
$("#tab-content").append(contentEl)
|
||||
|
||||
$("body").scrollTop(0)
|
||||
tabEl.on "shown", () =>
|
||||
$("body").scrollTop(0)
|
||||
|
||||
options.onShown() if options.onShown?
|
||||
for other_tab in @tabs
|
||||
if other_tab.id != options.id and other_tab.active and other_tab.onHidden?
|
||||
other_tab.onHidden()
|
||||
other_tab.active = false
|
||||
options.active = true
|
||||
|
||||
if options.lock
|
||||
@lockOpen()
|
||||
else
|
||||
|
@ -40,6 +53,7 @@ define [
|
|||
if options.contract
|
||||
@contract()
|
||||
|
||||
|
||||
lockOpen: () ->
|
||||
@locked_open = true
|
||||
$("#toolbar").css({
|
||||
|
|
|
@ -17,6 +17,14 @@ define [
|
|||
identifier: "trackChanges"
|
||||
element: @$el
|
||||
|
||||
@ide.tabManager.addTab
|
||||
id: "history"
|
||||
name: "History"
|
||||
after: "code"
|
||||
contract: true
|
||||
onShown: () => @show()
|
||||
onHidden: () => @hide()
|
||||
|
||||
@ide.editor.on "resize", () =>
|
||||
@diffView?.resize()
|
||||
|
||||
|
@ -34,17 +42,6 @@ define [
|
|||
@doc_id = doc_id
|
||||
@updateDiff()
|
||||
|
||||
@ide.fileTreeManager.on "contextmenu:beforeshow", (entity, entries) =>
|
||||
if entity instanceof Doc
|
||||
entries.push {
|
||||
divider: true
|
||||
}, {
|
||||
text: "History"
|
||||
onClick: () =>
|
||||
@doc_id = entity.id
|
||||
@show()
|
||||
}
|
||||
|
||||
show: () ->
|
||||
@changes = new ChangeList([], project_id: @project_id, ide: @ide)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue