mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
16 lines
396 B
CoffeeScript
16 lines
396 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.controller "BinaryFileController", ["$scope", "$rootScope", ($scope, $rootScope) ->
|
|
|
|
$scope.failedLoad = false
|
|
$rootScope.$on 'entity:selected', () ->
|
|
$scope.failedLoad = false
|
|
|
|
window.sl_binaryFilePreviewError = () =>
|
|
$scope.failedLoad = true
|
|
$scope.$apply()
|
|
|
|
$scope.extension = (file) ->
|
|
return file.name.split(".").pop()?.toLowerCase()
|
|
]
|