overleaf/services/web/public/coffee/file-tree/FileTreeView.coffee

26 lines
668 B
CoffeeScript
Raw Normal View History

2014-02-12 10:23:40 +00:00
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)
2014-02-12 10:23:40 +00:00