Permalink
Browse files

Fixing non-strict-mode compliant sigma plugin with illegal 'delete' u…

…sage.
  • Loading branch information...
1 parent 17988ea commit 68ece58c251f15c452592acf9c176ed69d937c8c @davidrapin davidrapin committed Dec 22, 2014
Showing with 8 additions and 6 deletions.
  1. +8 −6 plugins/sigma.exporters.svg/sigma.exporters.svg.js
@@ -1,4 +1,5 @@
;(function(undefined) {
+ 'use strict';
/**
* Sigma SVG Exporter
@@ -30,17 +31,18 @@
[data],
{type: 'image/svg+xml;charset=utf-8'}
);
- };
+ }
function download(string, filename) {
// Creating blob href
var blob = createBlob(string);
// Anchor
- var anchor = document.createElement('a');
- anchor.setAttribute('href', URL.createObjectURL(blob));
- anchor.setAttribute('download', filename);
+ var o = {};
+ o.anchor = document.createElement('a');
+ o.anchor.setAttribute('href', URL.createObjectURL(blob));
+ o.anchor.setAttribute('download', filename);
// Click event
var event = document.createEvent('MouseEvent');
@@ -49,8 +51,8 @@
URL.revokeObjectURL(blob);
- anchor.dispatchEvent(event);
- delete anchor;
+ o.anchor.dispatchEvent(event);
+ delete o.anchor;
}

0 comments on commit 68ece58

Please sign in to comment.