Skip to content

Commit

Permalink
Fixing non-strict-mode compliant sigma plugin with illegal 'delete' u…
Browse files Browse the repository at this point in the history
…sage.
  • Loading branch information
davidrapin committed Dec 22, 2014
1 parent 17988ea commit 68ece58
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugins/sigma.exporters.svg/sigma.exporters.svg.js
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
;(function(undefined) { ;(function(undefined) {
'use strict';


/** /**
* Sigma SVG Exporter * Sigma SVG Exporter
Expand Down Expand Up @@ -30,17 +31,18 @@
[data], [data],
{type: 'image/svg+xml;charset=utf-8'} {type: 'image/svg+xml;charset=utf-8'}
); );
}; }


function download(string, filename) { function download(string, filename) {


// Creating blob href // Creating blob href
var blob = createBlob(string); var blob = createBlob(string);


// Anchor // Anchor
var anchor = document.createElement('a'); var o = {};
anchor.setAttribute('href', URL.createObjectURL(blob)); o.anchor = document.createElement('a');
anchor.setAttribute('download', filename); o.anchor.setAttribute('href', URL.createObjectURL(blob));
o.anchor.setAttribute('download', filename);


// Click event // Click event
var event = document.createEvent('MouseEvent'); var event = document.createEvent('MouseEvent');
Expand All @@ -49,8 +51,8 @@


URL.revokeObjectURL(blob); URL.revokeObjectURL(blob);


anchor.dispatchEvent(event); o.anchor.dispatchEvent(event);
delete anchor; delete o.anchor;
} }




Expand Down

0 comments on commit 68ece58

Please sign in to comment.