Show More
@@ -430,7 +430,29 define([ | |||||
430 | that.notebook_path, |
|
430 | that.notebook_path, | |
431 | filename |
|
431 | filename | |
432 | ); |
|
432 | ); | |
433 | $.ajax(url, settings); |
|
433 | ||
|
434 | var exists = false; | |||
|
435 | $.each(that.element.find('.list_item:not(.new-file)'), function(k,v){ | |||
|
436 | if ($(v).data('name') === filename) { exists = true; return false; } | |||
|
437 | }); | |||
|
438 | if (exists) { | |||
|
439 | dialog.modal({ | |||
|
440 | title : "Replace file", | |||
|
441 | body : 'There is already a file named ' + filename + ', do you want to replace it?', | |||
|
442 | buttons : { | |||
|
443 | Overwrite : { | |||
|
444 | class: "btn-danger", | |||
|
445 | click: function() { $.ajax(url, settings); } | |||
|
446 | }, | |||
|
447 | Cancel : { | |||
|
448 | click: function() { item.remove(); } | |||
|
449 | } | |||
|
450 | } | |||
|
451 | }); | |||
|
452 | } else { | |||
|
453 | $.ajax(url, settings); | |||
|
454 | } | |||
|
455 | ||||
434 | return false; |
|
456 | return false; | |
435 | }); |
|
457 | }); | |
436 | var cancel_button = $('<button/>').text("Cancel") |
|
458 | var cancel_button = $('<button/>').text("Cancel") |
General Comments 0
You need to be logged in to leave comments.
Login now