Commit eb80edd3 authored by Douwe Maan's avatar Douwe Maan

Move page-specific JS out of head and into body.

parent 4d6a338c
...@@ -20,5 +20,3 @@ ...@@ -20,5 +20,3 @@
= render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id') = render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id')
= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id') = render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
= render 'layouts/bootlint' if Rails.env.development? = render 'layouts/bootlint' if Rails.env.development?
= yield :scripts_head
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body{class: "#{app_theme}", :'data-page' => body_data_page} %body{class: "#{app_theme}", :'data-page' => body_data_page}
/ Ideally this would be inside the head, but turbolinks only evaluates page-specific JS in the body.
= yield :scripts_body_top
- if current_user - if current_user
= render "layouts/header/default", title: header_title = render "layouts/header/default", title: header_title
- else - else
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
- header_title project_title(@project) - header_title project_title(@project)
- sidebar "project" unless sidebar - sidebar "project" unless sidebar
- content_for :scripts_head do - content_for :scripts_body_top do
-if current_user - if current_user
:javascript :javascript
window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
window.markdown_preview_path = "#{markdown_preview_namespace_project_path(@project.namespace, @project)}"; window.markdown_preview_path = "#{markdown_preview_namespace_project_path(@project.namespace, @project)}";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment