Эх сурвалжийг харах

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

Enrico Berti 10 жил өмнө
parent
commit
54025943af

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