Show More
@@ -307,7 +307,6 b' define([' | |||
|
307 | 307 | $.ajax(url, settings); |
|
308 | 308 | return false; |
|
309 | 309 | }); |
|
310 | // var new_buttons = item.find('a'); // shutdown_button; | |
|
311 | 310 | item.find(".item_buttons").append(shutdown_button); |
|
312 | 311 | }; |
|
313 | 312 | |
@@ -317,11 +316,8 b' define([' | |||
|
317 | 316 | click(function (e) { |
|
318 | 317 | // $(this) is the button that was clicked. |
|
319 | 318 | var that = $(this); |
|
320 | // We use the nbname and notebook_id from the parent notebook_item element's | |
|
321 | // data because the outer scopes values change as we iterate through the loop. | |
|
322 | var parent_item = that.parents('div.list_item'); | |
|
323 | var name = parent_item.data('name'); | |
|
324 | var path = parent_item.data('path'); | |
|
319 | var name = item.data('name'); | |
|
320 | var path = item.data('path'); | |
|
325 | 321 | var message = 'Are you sure you want to duplicate ' + name + '?'; |
|
326 | 322 | var copy_from = {copy_from : path}; |
|
327 | 323 | IPython.dialog.modal({ |
@@ -331,22 +327,9 b' define([' | |||
|
331 | 327 | Duplicate : { |
|
332 | 328 | class: "btn-primary", |
|
333 | 329 | click: function() { |
|
334 | var settings = { | |
|
335 |
|
|
|
336 |
|
|
|
337 | type : "POST", | |
|
338 | dataType : "json", | |
|
339 | data : JSON.stringify(copy_from), | |
|
340 | success : function () { | |
|
341 | notebooklist.load_list(); | |
|
342 | } | |
|
343 | }; | |
|
344 | var url = utils.url_join_encode( | |
|
345 | notebooklist.base_url, | |
|
346 | 'api/contents', | |
|
347 | notebooklist.notebook_path | |
|
348 | ); | |
|
349 | $.ajax(url, settings); | |
|
330 | notebooklist.contents.copy(path, notebooklist.notebook_path).then(function () { | |
|
331 | notebooklist.load_list(); | |
|
332 | }); | |
|
350 | 333 | } |
|
351 | 334 | }, |
|
352 | 335 | Cancel : {} |
General Comments 0
You need to be logged in to leave comments.
Login now