Add a spinner when waiting for image preview to load.

This commit is contained in:
Shane Kilkelly
2016-05-20 14:28:51 +01:00
parent eaa41e4361
commit 2441930fe9
4 changed files with 18 additions and 1 deletions
@@ -11,12 +11,20 @@ define [
error: false
data: null
# Callback fired when the `img` tag fails to load,
# `failedLoad` used to show the "No Preview" message
$scope.failedLoad = false
window.sl_binaryFilePreviewError = () =>
$scope.failedLoad = true
$scope.$apply()
# Callback fired when the `img` tag is done loading,
# `imgLoaded` is used to show the spinner gif while loading
$scope.imgLoaded = false
window.sl_binaryFilePreviewLoaded = () =>
$scope.imgLoaded = true
$scope.$apply()
$scope.extension = (file) ->
return file.name.split(".").pop()?.toLowerCase()