Refactor exportToCSV js function
This commit is contained in:
@@ -237,15 +237,13 @@ function exportToCSV() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace line breaks with spaces
|
// Replace line breaks with spaces and properly encode query
|
||||||
query = query.replace(/\n/g, " ");
|
query = window.encodeURI(query.replace(/\n/g, " "));
|
||||||
setCurrentTab("table_query");
|
|
||||||
|
|
||||||
query = window.encodeURI(query)
|
|
||||||
|
|
||||||
var url = "http://" + window.location.host + "/query?format=csv&query=" + query;
|
var url = "http://" + window.location.host + "/query?format=csv&query=" + query;
|
||||||
var win = window.open(url, '_blank');
|
var win = window.open(url, '_blank');
|
||||||
|
|
||||||
|
setCurrentTab("table_query");
|
||||||
win.focus();
|
win.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user