Load the locomotive mount path earlier in the JS to make it available for backbone models. Fixes #336
This commit is contained in:
parent
22f34a5a60
commit
6677689902
|
@ -4,7 +4,7 @@
|
||||||
#= require_tree ./views
|
#= require_tree ./views
|
||||||
|
|
||||||
window.Locomotive =
|
window.Locomotive =
|
||||||
mounted_on: '/locomotive' # default path
|
mounted_on: window.Locomotive.mounted_on
|
||||||
Models: {}
|
Models: {}
|
||||||
Collections: {}
|
Collections: {}
|
||||||
Views: {}
|
Views: {}
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
%meta{ :name => 'key-param', :content => Rails.application.config.session_options[:key] }
|
%meta{ :name => 'key-param', :content => Rails.application.config.session_options[:key] }
|
||||||
%meta{ :name => 'key-token', :content => cookies[key] }
|
%meta{ :name => 'key-token', :content => cookies[key] }
|
||||||
|
|
||||||
|
%script{ :type => 'text/javascript' }
|
||||||
|
:plain
|
||||||
|
window.Locomotive = { mounted_on: '#{Locomotive.mounted_on}' };
|
||||||
|
|
||||||
= stylesheet_link_tag 'locomotive', :media => 'screen'
|
= stylesheet_link_tag 'locomotive', :media => 'screen'
|
||||||
= javascript_include_tag 'locomotive'
|
= javascript_include_tag 'locomotive'
|
||||||
|
|
||||||
|
@ -15,7 +19,6 @@
|
||||||
window.locale = '#{I18n.locale}';
|
window.locale = '#{I18n.locale}';
|
||||||
window.content_locale = '#{::Mongoid::Fields::I18n.locale}';
|
window.content_locale = '#{::Mongoid::Fields::I18n.locale}';
|
||||||
|
|
||||||
Locomotive.mounted_on = '#{Locomotive.mounted_on}';
|
|
||||||
Locomotive.current_site = new Locomotive.Models.Site(#{current_site.to_json});
|
Locomotive.current_site = new Locomotive.Models.Site(#{current_site.to_json});
|
||||||
Locomotive.current_account = new Locomotive.Models.Account(#{current_locomotive_account.to_json});
|
Locomotive.current_account = new Locomotive.Models.Account(#{current_locomotive_account.to_json});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue