diff options
Diffstat (limited to 'app/views/projects/blob/_viewer.html.haml')
-rw-r--r-- | app/views/projects/blob/_viewer.html.haml | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/views/projects/blob/_viewer.html.haml b/app/views/projects/blob/_viewer.html.haml index 5326bb3e0cf..4252f27d007 100644 --- a/app/views/projects/blob/_viewer.html.haml +++ b/app/views/projects/blob/_viewer.html.haml @@ -1,12 +1,11 @@ - hidden = local_assigns.fetch(:hidden, false) - render_error = viewer.render_error -- load_asynchronously = local_assigns.fetch(:load_asynchronously, viewer.server_side?) && render_error.nil? +- load_async = local_assigns.fetch(:load_async, viewer.load_async?) -- url = url_for(params.merge(viewer: viewer.type, format: :json)) if load_asynchronously -.blob-viewer{ data: { type: viewer.type, url: url }, class: ('hidden' if hidden) } - - if load_asynchronously - .text-center.prepend-top-default.append-bottom-default - = icon('spinner spin 2x', 'aria-hidden' => 'true', 'aria-label' => 'Loading content') +- viewer_url = local_assigns.fetch(:viewer_url) { url_for(params.merge(viewer: viewer.type, format: :json)) } if load_async +.blob-viewer{ data: { type: viewer.type, url: viewer_url }, class: ('hidden' if hidden) } + - if load_async + = render viewer.loading_partial_path, viewer: viewer - elsif render_error = render 'projects/blob/render_error', viewer: viewer - else |