Skip to content

Commit

Permalink
use document title for exported svg file names instead svg object's i…
Browse files Browse the repository at this point in the history
…d which is always "svg"
  • Loading branch information
ozcan committed Mar 16, 2017
1 parent 19a8344 commit bd249ce
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions anvio/data/interactive/lib/svg-crowbar/svg-crowbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,8 @@ function svgCrowbar(options) {
function download(source) {
var filename = "untitled";

if (source.id) {
filename = source.id;
} else if (source.class) {
filename = source.class;
} else if (window.document.title) {
filename = window.document.title.replace(/[^a-z0-9]/gi, '-').toLowerCase();
if (window.document.title) {
filename = window.document.title.replace(/[^a-z0-9]/gi, '_');
}

var url = window.URL.createObjectURL(new Blob(source.source, { "type" : "text\/xml" }));
Expand Down

0 comments on commit bd249ce

Please sign in to comment.