File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
plugins/sigma.exporters.svg Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
; ( function ( undefined ) {
2
+ 'use strict' ;
2
3
3
4
/**
4
5
* Sigma SVG Exporter
30
31
[ data ] ,
31
32
{ type : 'image/svg+xml;charset=utf-8' }
32
33
) ;
33
- } ;
34
+ }
34
35
35
36
function download ( string , filename ) {
36
37
37
38
// Creating blob href
38
39
var blob = createBlob ( string ) ;
39
40
40
41
// Anchor
41
- var anchor = document . createElement ( 'a' ) ;
42
- anchor . setAttribute ( 'href' , URL . createObjectURL ( blob ) ) ;
43
- anchor . setAttribute ( 'download' , filename ) ;
42
+ var o = { } ;
43
+ o . anchor = document . createElement ( 'a' ) ;
44
+ o . anchor . setAttribute ( 'href' , URL . createObjectURL ( blob ) ) ;
45
+ o . anchor . setAttribute ( 'download' , filename ) ;
44
46
45
47
// Click event
46
48
var event = document . createEvent ( 'MouseEvent' ) ;
49
51
50
52
URL . revokeObjectURL ( blob ) ;
51
53
52
- anchor . dispatchEvent ( event ) ;
53
- delete anchor ;
54
+ o . anchor . dispatchEvent ( event ) ;
55
+ delete o . anchor ;
54
56
}
55
57
56
58
You can’t perform that action at this time.
0 commit comments