浏览代码

Changed for in loop to for of in order to be async safe

Manuel Gall 2 年之前
父节点
当前提交
437eedad20
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      template/js/ui.js

+ 3 - 3
template/js/ui.js

@@ -186,9 +186,9 @@ function showDocument() {
         type: "GET",
         url: 'frames.json',
         success: function(ret2) {
-          for (i in ret2.data) {
-            makeFrame(ret2.data[i].lx,ret2.data[i].ly,ret2.data[i].rx,ret2.data[i].ry, ret2.data[i].url, ret2.data[i].callback, ret2.data[i].default, ret2.data[i].showbutton, ret2.data[i].style);
-          }
+          for (i of ret2.data) {
+            makeFrame(i.lx,i.ly,i.rx,i.ry, i.url, i.callback, i.default, i.showbutton, i.style);
+          } 
         }
       });
     },