BinaryFilesManager.coffee 525 B

123456789101112131415161718192021
  1. define [
  2. "ide/binary-files/controllers/BinaryFileController"
  3. ], () ->
  4. class BinaryFilesManager
  5. constructor: (@ide, @$scope) ->
  6. @$scope.$on "entity:selected", (event, entity) =>
  7. if (@$scope.ui.view != "track-changes" and entity.type == "file")
  8. @openFile(entity)
  9. openFile: (file) ->
  10. @ide.fileTreeManager.selectEntity(file)
  11. @$scope.ui.view = "file"
  12. @$scope.openFile = null
  13. @$scope.$apply()
  14. window.setTimeout(
  15. () =>
  16. @$scope.openFile = file
  17. @$scope.$apply()
  18. , 0
  19. , this
  20. )