From b405f2c85740c95c7a9ddce2c1ac9bd5f23f3bb1 2014-11-17 18:09:53 From: David Neto Date: 2014-11-17 18:09:53 Subject: [PATCH] Add the "Duplicate" button in the main dashboard so we can copy an existing notebook without having to start it's instance --- diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 8e727f5..7ef34be 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -254,6 +254,7 @@ define([ } else if (model.type == 'notebook') { if(this.sessions[path_name] === undefined){ this.add_delete_button(item); + this.add_duplicate_button(item); } else { this.add_shutdown_button(item, this.sessions[path_name]); } @@ -306,7 +307,53 @@ define([ return false; }); // var new_buttons = item.find('a'); // shutdown_button; - item.find(".item_buttons").text("").append(shutdown_button); + item.find(".item_buttons").append(shutdown_button); + }; + + NotebookList.prototype.add_duplicate_button = function (item) { + var new_buttons = $('').addClass("btn-group pull-right"); + var notebooklist = this; + var duplicate_button = $("