From f2534e7428be3b67273a45fc17dd628f0b3d4684 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 29 Aug 2012 21:12:10 -0400 Subject: Show notification that no preview is available if no previewer is found for a public link to a file --- apps/files_sharing/js/public.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps/files_sharing/js/public.js') diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 755382e0736..1ab61d476ec 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -11,7 +11,11 @@ $(document).ready(function() { if (mimetype.substr(0, mimetype.indexOf('/')) != 'image') { // Trigger default action if not download TODO var action = FileActions.getDefault(mimetype, 'file', FileActions.PERMISSION_READ); - action($('#filename').val()); + if (typeof action === 'undefined') { + $('#noPreview').show(); + } else { + action($('#filename').val()); + } } } -- cgit v1.2.3