浏览代码

[notebook] Add code formatting to the latest execute all snippets function

Romain Rigaux 10 年之前
父节点
当前提交
b7ea99e199
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 7 - 5
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -951,20 +951,22 @@
     };
 
     self.executeAll = function () {
-      if (self.snippets().length < 1)
+      if (self.snippets().length < 1) {
         return;
-  
+      }
+
       var index = 0;
       self.snippets()[index].execute();
       var clock = setInterval(next, 100);
-  
+
       function next() {
         if (self.snippets()[index].status() == 'available' || self.snippets()[index].status() == 'failed') {
           index = index + 1;
-          if (self.snippets().length > index)
+          if (self.snippets().length > index) {
             self.snippets()[index].execute();
-          else
+          } else {
             clearInterval(clock);
+          }
         }
       }
     };