Extract export.js static asset

This commit is contained in:
John Firebaugh 2012-08-25 18:40:37 -07:00 committed by Tom Hughes
parent c2333c603e
commit cc4f133e64
5 changed files with 7 additions and 5 deletions

View file

@ -330,5 +330,3 @@ function mapnikSizeChanged() {
validateControls();
}
startExport("<%=j render :partial => "sidebar" %>");

View file

@ -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

View file

@ -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

View file

@ -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] -%>

View file

@ -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