diff options
| author | David Url <david@urld.io> | 2018-03-05 20:53:48 +0100 |
|---|---|---|
| committer | Andrew Bonventre <andybons@golang.org> | 2018-03-06 20:24:13 +0000 |
| commit | 057704a6290c29d3b08f62f96d3e2db6932f2ef5 (patch) | |
| tree | 318301b23ef82928e892131242bb847fd16d8fa2 | |
| parent | dacd8d859ccdabe9c7dfaddfd2f6cbc916866eea (diff) | |
| download | golang-id-tour-057704a6290c29d3b08f62f96d3e2db6932f2ef5.tar.xz | |
tour: kill running code snippets when changing page
When a new page is loaded, the backend is told to kill still running code snippets,
known to the frontend at this point.
Fixes golang/go#16418
Change-Id: Ie4c246b6bf9f566ef7523e35b44395a1abfd4e41
Reviewed-on: https://go-review.googlesource.com/98675
Reviewed-by: Andrew Bonventre <andybons@golang.org>
| -rwxr-xr-x | static/js/controllers.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/static/js/controllers.js b/static/js/controllers.js index c64fb04..f3b9cf7 100755 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -47,6 +47,7 @@ controller('EditorCtrl', ['$scope', '$routeParams', '$location', 'toc', 'i18n', $scope.gotoPage($scope.curPage - 1); }; $scope.gotoPage = function(page) { + $scope.kill(); var l = $routeParams.lessonId; if (page >= 1 && page <= lessons[$scope.lessonId].Pages.length) { $scope.curPage = page; |
