From b6d3bb0158e86a8d56ba5150c7a8cbe88e236d02 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Wed, 2 Oct 2019 14:14:52 -0700 Subject: [PATCH 1/2] successively look for .data('path') up parents --- notebook/static/tree/js/kernellist.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/notebook/static/tree/js/kernellist.js b/notebook/static/tree/js/kernellist.js index fb954124e..d14c8e858 100644 --- a/notebook/static/tree/js/kernellist.js +++ b/notebook/static/tree/js/kernellist.js @@ -85,7 +85,14 @@ define([ .addClass('btn btn-warning btn-xs') .text(i18n._('Shutdown')) .click(function() { - var path = $(this).parent().parent().parent().data('path'); + var parent = $(this).parent().parent().parent(); + var path = parent.data('path'): + if(!path) { + path = parent.parent().data('path'); + } + if(!path) { + throw new Error("Shutdown path not present"); + } that.shutdown_notebook(path); }) .appendTo(running_indicator); From 8f36daec83ab2ffd67c7795d9363b7d26b8eb47d Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Wed, 2 Oct 2019 16:56:11 -0700 Subject: [PATCH 2/2] Fixed semicolon --- notebook/static/tree/js/kernellist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/static/tree/js/kernellist.js b/notebook/static/tree/js/kernellist.js index d14c8e858..e3a7ddc9f 100644 --- a/notebook/static/tree/js/kernellist.js +++ b/notebook/static/tree/js/kernellist.js @@ -86,7 +86,7 @@ define([ .text(i18n._('Shutdown')) .click(function() { var parent = $(this).parent().parent().parent(); - var path = parent.data('path'): + var path = parent.data('path'); if(!path) { path = parent.parent().data('path'); }