Extract export.js static asset
This commit is contained in:
parent
c2333c603e
commit
cc4f133e64
5 changed files with 7 additions and 5 deletions
|
@ -330,5 +330,3 @@ function mapnikSizeChanged() {
|
|||
|
||||
validateControls();
|
||||
}
|
||||
|
||||
startExport("<%=j render :partial => "sidebar" %>");
|
|
@ -4,6 +4,7 @@
|
|||
//= require jquery.timers
|
||||
//= require i18n/translations
|
||||
//= require globals
|
||||
//= require export
|
||||
|
||||
/*
|
||||
* Called as the user scrolls/zooms around to aniplate hrefs of the
|
||||
|
|
|
@ -4,6 +4,7 @@ class ExportController < ApplicationController
|
|||
before_filter :set_locale
|
||||
|
||||
def start
|
||||
render :partial => "sidebar"
|
||||
end
|
||||
|
||||
#When the user clicks 'Export' we redirect to a URL which generates the export download
|
||||
|
|
|
@ -285,12 +285,14 @@ end
|
|||
|
||||
$(document).ready(function () {
|
||||
$("#exportanchor").click(function (e) {
|
||||
$.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
|
||||
$.ajax({ url: "<%= url_for :controller => :export, :action => :start %>", success: function (sidebarHtml) {
|
||||
startExport(sidebarHtml);
|
||||
}});
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
<% if params[:action] == 'export' -%>
|
||||
$.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
|
||||
$("#exportanchor").click();
|
||||
<% end -%>
|
||||
|
||||
<% if params[:query] -%>
|
||||
|
|
|
@ -18,7 +18,7 @@ class ExportControllerTest < ActionController::TestCase
|
|||
def test_start
|
||||
xhr :get, :start
|
||||
assert_response :success
|
||||
assert_template 'start'
|
||||
assert_template 'export/_sidebar'
|
||||
end
|
||||
|
||||
def test_finish_osm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue