Ver código fonte

resolve remarks

* use join
* don't use arrow functions
dev_h
DanielHabenicht 3 anos atrás
pai
commit
af18dd5de4
1 arquivos alterados com 9 adições e 6 exclusões
  1. 9
    6
      client-data/tools/download/download.js

+ 9
- 6
client-data/tools/download/download.js Ver arquivo

@@ -31,12 +31,15 @@
31 31
         var styleNode = document.createElement("style");
32 32
 
33 33
         // Copy the stylesheets from the whiteboard to the exported SVG
34
-        stylesheets = document.styleSheets;
35
-        styleText = "";
36
-        Array.from(stylesheets).forEach(stylesheet => {
37
-            styleText += "\n" + Array.from(stylesheet.cssRules).map(x => x.cssText).join("\n");
38
-        });
39
-        styleNode.innerHTML = styleText;
34
+        styleNode.innerHTML = Array.from(document.styleSheets).map(
35
+            function (stylesheet) {
36
+                return Array.from(stylesheet.cssRules).map(
37
+                    function (rule) {
38
+                        return rule.cssText
39
+                }
40
+            )}
41
+        ).join("\n")
42
+
40 43
         canvasCopy.appendChild(styleNode);
41 44
         downloadContent('data:image/svg+xml;charset=utf-8,' + encodeURIComponent(canvasCopy.outerHTML), "svg")
42 45
     }

Carregando…
Cancelar
Salvar