소스 검색

[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", {