diff --git a/IPython/html/static/tree/js/kernellist.js b/IPython/html/static/tree/js/kernellist.js index a4c318f..f522a8b 100644 --- a/IPython/html/static/tree/js/kernellist.js +++ b/IPython/html/static/tree/js/kernellist.js @@ -25,22 +25,25 @@ define([ KernelList.prototype = Object.create(notebooklist.NotebookList.prototype); + KernelList.prototype.add_duplicate_button = function () { + // do nothing + }; + KernelList.prototype.sessions_loaded = function (d) { this.sessions = d; this.clear_list(); - var item, path_name; - for (path_name in d) { - if (!d.hasOwnProperty(path_name)) { + var item, path; + for (path in d) { + if (!d.hasOwnProperty(path)) { // nothing is safe in javascript continue; } item = this.new_item(-1); this.add_link({ - name: path_name, - path: '', + name: path, + path: path, type: 'notebook', }, item); - this.add_shutdown_button(item, this.sessions[path_name]); } $('#running_list_header').toggle($.isEmptyObject(d)); }; diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 7ef34be..a592aeb 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -248,15 +248,16 @@ define([ if (model.type !== "directory") { link.attr('target','_blank'); } - var path_name = utils.url_path_join(path, name); + if (model.type !== 'directory') { + this.add_duplicate_button(item); + } if (model.type == 'file') { this.add_delete_button(item); } else if (model.type == 'notebook') { - if(this.sessions[path_name] === undefined){ + if (this.sessions[path] === undefined){ this.add_delete_button(item); - this.add_duplicate_button(item); } else { - this.add_shutdown_button(item, this.sessions[path_name]); + this.add_shutdown_button(item, this.sessions[path]); } } }; @@ -311,20 +312,20 @@ define([ }; NotebookList.prototype.add_duplicate_button = function (item) { - var new_buttons = $('').addClass("btn-group pull-right"); var notebooklist = this; - var duplicate_button = $("