瀏覽代碼

[editor] Put the id of the notebook in the URL when executing

Enrico Berti 10 年之前
父節點
當前提交
54025943af
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 4 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -436,6 +436,10 @@
 
       $.post("/notebook/api/historify", {
         notebook: ko.mapping.toJSON(self, SPARK_MAPPING)
+      }, function(data){
+        if (vm.editorMode && data && data.status == 0 && data.id && typeof history.pushState != 'undefined'){
+          history.pushState(null, null, '/notebook/editor?editor=' + data.id);
+        }
       });
 
       $.post("/notebook/api/execute", {