Move edit JS to page-specific script file
This commit is contained in:
parent
d62e8c43f3
commit
e83d43ca82
3 changed files with 37 additions and 36 deletions
32
app/assets/javascripts/edit.js
Normal file
32
app/assets/javascripts/edit.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
function maximiseMap() {
|
||||
$("#left").hide();
|
||||
$("#greeting").hide();
|
||||
$("#tabnav").hide();
|
||||
|
||||
$("#content").css("top", "0px");
|
||||
if ($("html").attr("dir") == "ltr") {
|
||||
$("#content").css("left", "0px");
|
||||
} else {
|
||||
$("#content").css("right", "0px");
|
||||
}
|
||||
|
||||
handleResize();
|
||||
}
|
||||
|
||||
function minimiseMap() {
|
||||
$("#left").show();
|
||||
$("#greeting").show();
|
||||
$("#tabnav").show();
|
||||
|
||||
$("#content").css("top", "30px");
|
||||
if ($("html").attr("dir") == "ltr") {
|
||||
$("#content").css("left", "185px");
|
||||
} else {
|
||||
$("#content").css("right", "185px");
|
||||
}
|
||||
|
||||
handleResize();
|
||||
}
|
||||
|
||||
$(document).ready(handleResize);
|
||||
$(window).resize(handleResize);
|
|
@ -9,44 +9,13 @@
|
|||
<p><%= raw t 'site.edit.not_public_description', :user_page => (link_to t('site.edit.user_page_link'), {:controller => 'user', :action => 'account', :display_name => @user.display_name, :anchor => 'public'}) %></p>
|
||||
<p><%= raw t 'site.edit.anon_edits', :link => link_to(t('site.edit.anon_edits_link_text'), t('site.edit.anon_edits_link')) %></p>
|
||||
<% else %>
|
||||
<% content_for :head do %>
|
||||
<%= javascript_include_tag "edit" %>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'home_link' %>
|
||||
<%= render :partial => 'sidebar' %>
|
||||
<%= render :partial => 'search' %>
|
||||
|
||||
<%= render :partial => preferred_editor %>
|
||||
|
||||
<script type="text/javascript">
|
||||
function maximiseMap() {
|
||||
$("#left").hide();
|
||||
$("#greeting").hide();
|
||||
$("#tabnav").hide();
|
||||
|
||||
$("#content").css("top", "0px");
|
||||
if ($("html").attr("dir") == "ltr") {
|
||||
$("#content").css("left", "0px");
|
||||
} else {
|
||||
$("#content").css("right", "0px");
|
||||
}
|
||||
|
||||
handleResize();
|
||||
}
|
||||
|
||||
function minimiseMap() {
|
||||
$("#left").show();
|
||||
$("#greeting").show();
|
||||
$("#tabnav").show();
|
||||
|
||||
$("#content").css("top", "30px");
|
||||
if ($("html").attr("dir") == "ltr") {
|
||||
$("#content").css("left", "185px");
|
||||
} else {
|
||||
$("#content").css("right", "185px");
|
||||
}
|
||||
|
||||
handleResize();
|
||||
}
|
||||
|
||||
$(document).ready(handleResize);
|
||||
$(window).resize(handleResize);
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
|
@ -56,7 +56,7 @@ OpenStreetMap::Application.configure do
|
|||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||
config.assets.precompile += %w( index.js pngfix.js swfobject.js )
|
||||
config.assets.precompile += %w( index.js edit.js pngfix.js swfobject.js )
|
||||
config.assets.precompile += %w( large-ltr.css small-ltr.css print-ltr.css )
|
||||
config.assets.precompile += %w( large-rtl.css small-rtl.css print-rtl.css )
|
||||
config.assets.precompile += %w( browse.css theme/openstreetmap/style.css )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue