mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 14:32:17 +00:00
Undelegate old events when refreshing history
This commit is contained in:
parent
fe99be48ac
commit
dfdfba4b2e
2 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,9 @@ define [
|
||||||
overflow: "scroll"
|
overflow: "scroll"
|
||||||
this
|
this
|
||||||
|
|
||||||
|
remove: () ->
|
||||||
|
@undelegateEvents()
|
||||||
|
|
||||||
addItem: (model) ->
|
addItem: (model) ->
|
||||||
index = @collection.indexOf(model)
|
index = @collection.indexOf(model)
|
||||||
previousModel = @collection.models[index - 1]
|
previousModel = @collection.models[index - 1]
|
||||||
|
|
|
@ -47,6 +47,9 @@ define [
|
||||||
show: () ->
|
show: () ->
|
||||||
@changes = new ChangeList([], project_id: @project_id, ide: @ide)
|
@changes = new ChangeList([], project_id: @project_id, ide: @ide)
|
||||||
|
|
||||||
|
if @changeListView?
|
||||||
|
@changeListView.remove()
|
||||||
|
|
||||||
@changeListView = new ChangeListView(
|
@changeListView = new ChangeListView(
|
||||||
el: @$el.find(".change-list-area")
|
el: @$el.find(".change-list-area")
|
||||||
collection: @changes
|
collection: @changes
|
||||||
|
|
Loading…
Reference in a new issue