mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 13:58:46 -05:00
25 lines
668 B
CoffeeScript
25 lines
668 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()
|
|
|
|
setLabels: (labels) ->
|
|
@rootFolderView.setLabels(labels)
|
|
|