From 66b4f2d2dbdf3e5440763a67f5fbfa07c402f6b1 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 14 Aug 2013 10:05:23 +0200 Subject: [PATCH] Moved to defer attribute for js include script. --- app/assets/javascripts/application.js | 5 +++++ app/views/init/index.html.erb | 7 +------ app/views/layouts/application.html.erb | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index aa9197f22..8988c1bb1 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -71,3 +71,8 @@ jQuery.event.special.remove = { if (e.handler) e.handler(); } }; + +// start application +jQuery(function(){ + new App.Run(); +}); \ No newline at end of file diff --git a/app/views/init/index.html.erb b/app/views/init/index.html.erb index 8d1cfe9cc..748969958 100644 --- a/app/views/init/index.html.erb +++ b/app/views/init/index.html.erb @@ -5,9 +5,4 @@
-
- + \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7ef0850f3..6f8dbd98e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,7 +3,11 @@ <%= Setting.get('product_name') %> <%= stylesheet_link_tag "application" %> + <% if Rails.configuration.assets.debug %> <%= javascript_include_tag "application" %> + <% else %> + <%= javascript_include_tag "application", :defer => 'defer' %> + <% end %> <%= csrf_meta_tags %>