From b99eaecf826c37ff4794c1233377b1322eb21c52 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 20 Mar 2014 15:30:04 +0000 Subject: [PATCH] Load history view using mainAreaManager --- .../web/public/coffee/editor/Editor.coffee | 7 ------ .../track-changes/TrackChangesManager.coffee | 22 ++++--------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/services/web/public/coffee/editor/Editor.coffee b/services/web/public/coffee/editor/Editor.coffee index c7eb19d9d8..c74a85522d 100644 --- a/services/web/public/coffee/editor/Editor.coffee +++ b/services/web/public/coffee/editor/Editor.coffee @@ -351,10 +351,3 @@ define [ getCurrentDocId: () -> @current_doc_id - - show: () -> - $("#editor").show() - - hide: () -> - $("#editor").hide() - diff --git a/services/web/public/coffee/track-changes/TrackChangesManager.coffee b/services/web/public/coffee/track-changes/TrackChangesManager.coffee index b87a94115f..22f87f6cca 100644 --- a/services/web/public/coffee/track-changes/TrackChangesManager.coffee +++ b/services/web/public/coffee/track-changes/TrackChangesManager.coffee @@ -13,11 +13,9 @@ define [ constructor: (@ide) -> @project_id = window.userSettings.project_id @$el = $(@template) - $("#editorWrapper").append(@$el) - @hideEl() - - @ide.editor.on "change:doc", () => - @hideEl() + @ide.mainAreaManager.addArea + identifier: "trackChanges" + element: @$el @ide.editor.on "resize", () => @diffView?.resize() @@ -58,10 +56,9 @@ define [ if @diffView? @diffView.destroy() - @showEl() + @ide.mainAreaManager.change "trackChanges" hide: () -> - @hideEl() @ide.fileTreeManager.openDoc(@doc_id) autoSelectDiff: () -> @@ -113,9 +110,7 @@ define [ to = null for change in @changes.models.slice(toIndex, fromIndex + 1) - console.log "considering change" for doc in change.get("docs") - console.log "considering doc", doc.id, doc_id if doc.id == doc_id if from? and to? from = Math.min(from, doc.fromV) @@ -124,18 +119,9 @@ define [ from = doc.fromV to = doc.toV break - console.log "Done", from, to return {from, to} - showEl: -> - @ide.editor.hide() - @$el.show() - - hideEl: () -> - @ide.editor.show() - @$el.hide() - restore: (change) -> name = @ide.fileTreeManager.getNameOfEntityId(@doc_id) date = moment(change.get("start_ts")).format("Do MMM YYYY, h:mm:ss a")