diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 9f66a3183..3fc29bee2 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -438,8 +438,8 @@ define([ }); this.selected = selected; - // Rename is only visible when one item is selected. - if (selected.length==1) { + // Rename is only visible when one item is selected, and it is not a running notebook + if (selected.length==1 && !has_running_notebook) { $('.rename-button').css('display', 'inline-block'); } else { $('.rename-button').css('display', 'none'); @@ -586,29 +586,32 @@ define([ if (this.selected.length != 1) return; var that = this; - var path = this.selected[0].path; + var item_path = this.selected[0].path; + var item_name = this.selected[0].name; + var item_type = this.selected[0].type; + console.log(this.selected[0]); var input = $('').attr('type','text').attr('size','25').addClass('form-control') - .val(path); + .val(item_name); var dialog_body = $('
').append( $("").addClass("rename-message") - .text('Enter a new directory name:') + .text('Enter a new '+ item_type + ' name:') ).append( $("