mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-03 06:19:30 -05:00
23 lines
605 B
CoffeeScript
23 lines
605 B
CoffeeScript
|
define [
|
||
|
"file-tree/RootFolderView"
|
||
|
"libs/backbone"
|
||
|
], (RootFolderView) ->
|
||
|
FileTreeView = Backbone.View.extend
|
||
|
initialize: (@manager) ->
|
||
|
|
||
|
template: $("#fileTreeTemplate").html()
|
||
|
|
||
|
render: () ->
|
||
|
@$el.append($(@template))
|
||
|
return @
|
||
|
|
||
|
bindToRootFolder: (rootFolder) ->
|
||
|
entities = @$('.js-file-tree')
|
||
|
# This is hacky, we're doing nothing to clean up the old folder tree
|
||
|
# from memory, just removing it from the DOM.
|
||
|
entities.empty()
|
||
|
@rootFolderView = new RootFolderView(model: rootFolder, manager: @manager)
|
||
|
entities.append(@rootFolderView.$el)
|
||
|
@rootFolderView.render()
|
||
|
|