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

This commit is contained in:
Douwe Maan 2015-06-09 12:01:18 +02:00
parent 4d6a338cc4
commit eb80edd34f
3 changed files with 5 additions and 4 deletions

View File

@ -20,5 +20,3 @@
= 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/bootlint' if Rails.env.development?
= yield :scripts_head

View File

@ -2,6 +2,9 @@
%html{ lang: "en"}
= render "layouts/head"
%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
= render "layouts/header/default", title: header_title
- else

View File

@ -2,8 +2,8 @@
- header_title project_title(@project)
- sidebar "project" unless sidebar
- content_for :scripts_head do
-if current_user
- content_for :scripts_body_top do
- if current_user
:javascript
window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
window.markdown_preview_path = "#{markdown_preview_namespace_project_path(@project.namespace, @project)}";