overleaf/services/web/public/coffee/ide/binary-files/BinaryFilesManager.coffee

22 lines
525 B
CoffeeScript
Raw Normal View History

2014-07-08 07:02:26 -04:00
define [
"ide/binary-files/controllers/BinaryFileController"
], () ->
class BinaryFilesManager
constructor: (@ide, @$scope) ->
@$scope.$on "entity:selected", (event, entity) =>
if (@$scope.ui.view != "track-changes" and entity.type == "file")
@openFile(entity)
openFile: (file) ->
2018-03-12 08:40:44 -04:00
@ide.fileTreeManager.selectEntity(file)
2014-07-08 07:02:26 -04:00
@$scope.ui.view = "file"
@$scope.openFile = null
@$scope.$apply()
window.setTimeout(
() =>
@$scope.openFile = file
@$scope.$apply()
, 0
, this
)