diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-03-01 10:33:06 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-03-01 20:28:33 +0300 |
commit | 2d8966f7f521c3d5eae47ff5f1cbc13d37cfc185 (patch) | |
tree | e0e4826a6b9f7c5d0985cdb9755d367cfc654baa /app/views/projects | |
parent | 52e133d17627396f29c1875b972534eaba4a837e (diff) |
migrate balsamiq_viewer to dynamic import
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/blob/_viewer.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/blob/viewers/_balsamiq.html.haml | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/app/views/projects/blob/_viewer.html.haml b/app/views/projects/blob/_viewer.html.haml index cc85e5de40f..3124443b4e4 100644 --- a/app/views/projects/blob/_viewer.html.haml +++ b/app/views/projects/blob/_viewer.html.haml @@ -1,9 +1,10 @@ - hidden = local_assigns.fetch(:hidden, false) - render_error = viewer.render_error +- rich_type = viewer.type == :rich ? viewer.partial_name : nil - load_async = local_assigns.fetch(:load_async, viewer.load_async? && render_error.nil?) - 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) } +.blob-viewer{ data: { type: viewer.type, rich_type: rich_type, url: viewer_url }, class: ('hidden' if hidden) } - if render_error = render 'projects/blob/render_error', viewer: viewer - elsif load_async diff --git a/app/views/projects/blob/viewers/_balsamiq.html.haml b/app/views/projects/blob/viewers/_balsamiq.html.haml index 15349387eb2..b20106e8c3a 100644 --- a/app/views/projects/blob/viewers/_balsamiq.html.haml +++ b/app/views/projects/blob/viewers/_balsamiq.html.haml @@ -1,4 +1 @@ -- content_for :page_specific_javascripts do - = webpack_bundle_tag('balsamiq_viewer') - .file-content.balsamiq-viewer#js-balsamiq-viewer{ data: { endpoint: blob_raw_path } } |